Sei sulla pagina 1di 49

SEMESTER: 5

LAB MANUAL
COMPUTER NETWORK
150702





Name: _________________________________
Enrollment No: __________________________
Batch: _________________________________





GANDHINAGAR INSTITUE OF TECHNOLOGY
DEPARTMENT OF INFORMATION TECHNOLOGY/COMPUTER ENGINEERING

Gandhinagar Institute of Technology Computer Network 150702
2
INDEX

SR.
NO.
AIM
PAGE.
NO.
DATE REMARK SIGN
1 To study about different network topologies.
Bus, Star, Ring, Mesh, Hybrid

2 To study about Cables and Connectors.
Twisted Pair, Co-Axial, Fiber
Optics Cable
BNC and RJ-45 Connectors.

3 To study about various networking Devices.
Switch, Hub, Router, Gateway,
Repeater, Bridge

4 To demonstrate how to connect the computers
in Local Area Network.

5 To study about OSI Reference model and
TCP/IP model with their differences.

6 To demonstrate different Networking
Commands (ping, Traceroute, pathping, Date,
Netstat etc.)

7
To study about various socket calls.
8 Write a program to implement the data link
layer framing method like the concept of bit
stuffing.

9 Write a program to implement the data link
layer framing method like the concept of
character stuffing.

10 To demonstrate how to install Packet Tracer
and implementation of Network Topology
using Packet Tracer.

Gandhinagar Institute of Technology Computer Network 150702
3
11 To Study of Network IP Address.
Classification of IP address , Sub
netting, Super netting and Masking

12
To study about WWW and HTTP



Gandhinagar Institute of Technology Computer Network 150702
4
EXPERIMENT NO: 1

TITLE: To study about different network topologies.


OBJECTIVE: On completion of this exercise student will able to know about

Bus Topology
Star Topology
Ring Topology
Mesh Topology
Hybrid Topology

THEORY:
A Network Topology is the way computer systems or network equipment connected to each other.
Topologies may define both physical and logical aspect of the network. Both logical and physical
topologies could be same or different in a same network.

Point-to-point
Point-to-point networks contains exactly two hosts (computer or switches or routers or servers) connected
back to back using a single piece of cable. Often, the receiving end of one host is connected to sending
end of the other end and vice-versa.

Image: Point-to-point Topology
If the hosts are connected point-to-point logically, then may have multiple intermediate devices. But the
end hosts are unaware of underlying network and see each other as if they are connected directly.

Bus Topology
In contrast to point-to-point, in bus topology all device share single communication line or cable. All
devices are connected to this shared line. Bus topology may have problem while more than one hosts
sending data at the same time. Therefore, the bus topology either uses CSMA/CD technology or
recognizes one host has Bus Master to solve the issue. It is one of the simple forms of networking where a
failure of a device does not affect the others. But failure of the shared communication line make all other
devices fail.
Gandhinagar Institute of Technology Computer Network 150702
5

[Image: Bus Topology]
Both ends of the shared channel have line terminator. The data is sent in only one direction and as soon as
it reaches the extreme end, the terminator removes the data from the line.

Star Topology
All hosts in star topology are connected to a central device, known as Hub device, using a point-to-point
connection. That is, there exists a point to point connection between hosts and Hub. The hub device can
be Layer-1 device (Hub / repeater) or Layer-2 device (Switch / Bridge) or Layer-3 device (Router /
Gateway).

[Image: Star Topology]
As in bus topology, hub acts as single point of failure. If hub fails, connectivity of all hosts to all other
hosts fails. Every communication happens between hosts, goes through Hub only. Star topology is not
expensive as to connect one more host, only one cable is required and configuration is simple.

Ring Topology
In ring topology, each host machine connects to exactly two other machines, creating a circular network
structure. When one host tries to communicate or send message to a host which is not adjacent to it, the
data travels through all intermediate hosts. To connect one more host in the existing structure
administrator may need only one more extra cable.
Gandhinagar Institute of Technology Computer Network 150702
6

[Image: Ring Topology]
Failure of any host results in failure of the whole ring. Thus every connection in the ring is point of
failure. There exist methods which employs one more backup ring.

Mesh Topology
In this type of topology, a host is connected to one or two or more than two hosts. This topology may
have hosts having point-to-point connection to every other hosts or may also have hosts which are having
point to point connection to few hosts only.

[Image: Full Mesh Topology]
Hosts in Mesh topology also work as relay for other hosts which do not have direct point-to-point links.
Mesh technology comes into two flavors:
Full Mesh: All hosts have a point-to-point connection to every other host in the network. Thus
for every new host n (n-1)/2 cables (connection) are required. It provides the most reliable
network structure among all network topologies.
Partially Mesh: Not all hosts have point-to-point connection to every other host. Hosts connect
to each other in some arbitrarily fashion. This topology exists where we need to provide
reliability to some host whereas others are not as such necessary.



Gandhinagar Institute of Technology Computer Network 150702
7
Tree Topology
Also known as Hierarchical Topology is the most common form of network topology in use present day.
This topology imitates as extended Star Topology and inherits properties of Bus topology.
This topology divides the network in to multiple levels/layers of network. Mainly in LANs, a network is
bifurcated into three types of network devices. The lowest most is access-layer where users computer are
attached. The middle layer is known as distribution layer, which works as mediator between upper layer
and lower layer. The highest most layers are known as Core layer, and is central point of the network, i.e.
root of the tree from which all nodes fork.

[Image: Tree Topology]
All neighboring hosts have point-to-point connection between them. Like bus topology, if the root goes
down, the entire network suffers. Though it is not the single point of failure. Every connection serves as
point of failure, failing of which divides the network into unreachable segment and so on.

Daisy Chain
This topology connects all its hosts in a linear fashion. Similar to Ring topology, all hosts in this topology
are connected to two hosts only, except the end hosts. That is if the end hosts in Daisy Chain are
connected then it represents Ring topology.

[Image: Daisy Chain Topology]
Each link in Daisy chain topology represents single point of failure. Every link failure splits the network
into two segments. Every intermediate host works as relay for its immediate hosts.

Hybrid Topology
A network structure whose design contains more than one topology is said to be Hybrid Topology.
Hybrid topology inherits merits and demerits of all the incorporating topologies.
Gandhinagar Institute of Technology Computer Network 150702
8

[Image: Hybrid Topology]
The above picture represents an arbitrarily Hybrid topology. The combining topologies may contain
attributes of Star, Ring, and Bus and Daisy-chain topologies. Most WANs are connected by means of dual
Ring topology and networks connected to them are mostly Star topology networks. Internet is the best
example of largest Hybrid topology

Advantages of a Linear Bus Topology
Easy to connect a computer or peripheral to a linear bus.
Requires less cable length than a star topology.
Disadvantages of a Linear Bus Topology
Entire network shuts down if there is a break in the main cable.
Terminators are required at both ends of the backbone cable.
Difficult to identify the problem if the entire network shuts down.
Not meant to be used as a stand-alone solution in a large building.

Advantages of a Star Topology
Easy to install and wire.
No disruptions to the network when connecting or removing devices.
Easy to detect faults and to remove parts.
Disadvantages of a Star Topology
Requires more cable length than a linear topology.
If the hub, switch, or concentrator fails, nodes attached are disabled.
More expensive than linear bus topologies because of the cost of the hubs, etc.

Advantages of a Tree Topology
Point-to-point wiring for individual segments.
Supported by several hardware and software venders.
Gandhinagar Institute of Technology Computer Network 150702
9
Disadvantages of a Tree Topology
Overall length of each segment is limited by the type of cabling used.
If the backbone line breaks, the entire segment goes down.
More difficult to configure and wire than other topologies.

Considerations When Choosing a Topology
Money. A linear bus network may be the least expensive way to install a network; you do not
have to purchase concentrators.
Length of cable needed. The linear bus network uses shorter lengths of cable.
Future growth. With a star topology, expanding a network is easily done by adding another
concentrator.
Cable type. The most common cable in schools is unshielded twisted pair, which is most often
used with star topologies.

Bus Network

-Advantages
Easy to implement and extend
Well suited for temporary networks (quick setup)
Initially less expensive than other topologies
Cheap
-Disadvantages
Difficult to administer/troubleshoot.
Limited cable length and number of stations.
If there is a problem with the cable, the entire network goes down.
Maintenance costs may be higher in the long run.
Performance degrades as additional computers are added or on heavy traffic.
Low security (all computers on the bus can see all data transmissions).
One virus in the network will affect all of them (but not as badly as a star or ring
network).
Proper termination is required.(loop must be in closed path).
If one node fails, the whole network will shut down.
If many computers are attached, the amount of data flowing causes the network to slow
down.
Ring Network

-Advantages
Gandhinagar Institute of Technology Computer Network 150702
10
Data is quickly transferred without a bottle neck. (very fast, all data traffic is in the
same direction)
The transmission of data is relatively simple as packets travel in one direction only.
Adding additional nodes has very little impact on bandwidth
It prevents network collisions because of the media access method or architecture
required.
-Disadvantages
Data packets must pass through every computer between the sender and recipient
therefore this makes it slower.
If any of the nodes fail then the ring is broken and data cannot be transmitted
successfully.
It is difficult to troubleshoot the ring.
Because all stations are wired together, to add a station you must shut down the network
temporarily.
In order for all computers to communicate with each other, all computers must be turned
on.
Total dependence upon the one cable
Star Network

-Advantages
Good performance
easy to set up and to expand. Any non-centralised failure will have very little effect on
the network, whereas on a ring network it would all fail with one fault
-Disadvantages
Expensive to install
Extra hardware required


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10



Gandhinagar Institute of Technology Computer Network 150702
11
Signature: ____________

Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
12
EXPERIMENT NO: 2

TITLE: To study about Cables and Connectors.
OBJECTIVE: On completion of this exercise student will able to know about
Twisted Pair, Co-Axial, Fiber Optics Cable
BNC and RJ-45 Connectors.

THEORY:

In this section, we will take a look at the various LAN and WAN network types as well as the cables
and connectors used in modern networks.

Cabling:
The most common form of LAN uses Ethernet which is a collection of standards and specifications that
define wiring and signaling for the network. There are a wide variety of standards and cable types. The
most common cable types are discussed below:

Coaxial - Older Ethernet technologies such as 10Base5 and 10Base2 used coaxial cable (RG-58). These
network types are no longer in use. This type of network connection has made a recent comeback and is
being used for broadband cable internet connections (RG-59).

Unshielded Twisted Pair (UTP) - UTP is a cable type that consists of two or
more insulated copper conductors in which each pair of conductors are twisted
around each other. Category 1 UTP cables are used for telephony connections.
Category 3 and higher is used for Ethernet LAN connections. UTP is inexpensive and easy to work with.

Shielded twisted pair (STP) - This type of cable is the same as unshielded
twisted pair (UTP), except that it has shielding around it to provide more
protection against electromagnetic interference (EMI). Because of its higher cost,
it is typically only used in environments where it is necessary.


Fiber Optic - Previously only used for WAN connections, fiber optic cabling is
now increasingly being used on LANs as well for its capacity for longer distance
and higher speeds. A fiber-optic system is similar to the copper wire system
(UTP/STP), however, fiber-optics use light pulses to transmit information down fiber lines instead of
using electronic pulses to transmit information down copper lines. Fiber cables are made of transparent
glass or plastic fibers which allow light to be guided from one end to the other. There are 2 types of fiber
cabling - Single-mode fiber (SMF) and multi-mode fiber (MMF). MMF is the most common type used,
however, SMF can support longer distances and higher speeds.

A plenum area is the air return for an air conditioning system. In most buildings, the plenum area above a
drop ceiling is used as the source of air for the air conditioning systems. Wire and cable are usually
installed in this area, and if that wire burns during a fire, it will emit toxic fumes. The fumes could carry
to the rest of the building through the air conditioner, and, as a result, the fumes could harm others.
Plenum grade cabling is required in these types of installations because it is resistant to fire and does not
emit poisonous gasses when burned. PVC cables (the standard variety), while cheaper, will emit
poisonous gases in extreme heat or fire. Plenum grade cabling is quite a bit more expensive.
Gandhinagar Institute of Technology Computer Network 150702
13

The various cable types vary in their capacity to transmit data. The definition of the word "bandwidth"
can get complicated, but for the purposes of the A+ exam, this term will mean the transmission speed on a
network. This next table lists the transmission speeds/bandwidth of the various cable types.

Transmission Medium Transmission Speed
cat 3 twisted pair 10 mbps
cat 5 twisted pair 100 mbps
cat 5e twisted pair 1 gbps
cat 6 twisted pair 10 gbps
Fiber Optic 100 mbps - 1 gbps

RJ-45 (Registered Jack)
The acronym for Registered Jack-45 is RJ-45. The RJ-45 connector is an eight-wire connector that is
commonly used to connect computers to a local area network (LAN), particularly Ethernet LANs.
Although they are slightly larger

Connectors:
Just like their are a variety of cable types, there are a variety of connectors used with these cables. Let's
take look at the most common ones - please note that the images are not to scale.

BNC - This connector has found uses with both broadcast television equipment
and computer networks. With regards to networking, this connector was used
on early 10Base-2 (Thinnet) Ethernet networks. It has a center pin connected to
the center coaxial cable conductor and a metal tube connected to the outer
cable shield. A rotating ring outside the tube locks the cable to the female connector.

F Connector - This connector is the one used for home broadband cable
connections with coaxial cable. This male connector screws onto the female
counterpart. The connection typically runs coax from the wall outlet to the
cable modem. The cable modem will have a RJ-45 jack for connection a
computer or wireless access point.
Gandhinagar Institute of Technology Computer Network 150702
14


RJ-11 - Short for Registered Jack-11, a four or six-wire connector used
primarily to connect telephone equipment in the United States (POTS). The
cable itself is called category 1 (Cat 1) and is used for dial-up connections.
Modems have rj-11 jacks that connect them to the wall outlet.



RJ-45 - Short for Registered Jack-45, it is an eight-wire connector used
commonly to connect devices on Ethernet LANs. RJ-45 connectors look
similar to RJ-11 connectors used for connecting telephone equipment, but
they are larger.


ST Connector - The ST connector is a fiber optic connector which uses a
plug and socket which is locked in place with a half-twist bayonet lock. The
ST connector was the first standard for fiber optic cabling. ST Connectors are
half-duplex.


SC Connector - The SC connector is a fiber optic connector with a push-pull
latching mechanism which provides quick insertion and removal while also
ensuring a positive connection. SC Connectors are half-duplex.


LC - The LC connector is just like a SC connector only it is half the size. Like
SC connectors, LC connectors are half-duplex.



MT-RJ - Stands for Mechanical Transfer Registered Jack. It is a newer fiber
optic connector that somewhat resembles a RJ-45 connector. It has a small
size, low cost, easy installation, and supports full-duplex.



Ethernet LAN Types
Now that we have gone through the various cables and connectors, let's put it all together and look at the
most common Ethernet types in use today.

Name Cable Type Connector Maximum Length Speed
10Base-T Category 3 or better UTP cable RJ-45 100 meters(328 ft) 10 mbps
10Base-FL Fiber optic cable ST, SC, LC, MT-RJ 2000 meters 10 mbps
100Base-TX Cat 5 twisted pair RJ-45 100 meters(328 ft) 100 mbps
100Base-FX Fiber Optic ST, SC, LC, MT-RJ 2000 meters 100 mbps
1000Base-T CAT5e or higher RJ-45 100 meters(328 ft) 1 gbps

Note that there are emerging fiber optic technologies such as laser over fiber that have faster speeds and
Gandhinagar Institute of Technology Computer Network 150702
15
longer distances, but are probably outside the scope of the A+ exam. Also note that wireless networking
types are covered in a different section of this guide.

Remote Access:
For the purposes of the A+ exam, you will need to be familiar with the following methods of connecting
to the internet:
Network Type Speed Connection Description
Dial-up connection
(POTS)
Up to 56
Kbps
Twisted pair with
RJ-11 connector.
Rapidly being replaced by broadband
technologies such as DSL and cable.
Integrated Services
Digital Network (ISDN)
128 kbps Twister pair with RJ-
11 connector.
Business access
Digital Subscriber Line
(DSL)
256 Kbps to
8 Mbps
Twisted-pair with
RJ-45 connector.
Home, small business, and enterprise
access using existing phone lines.
Cable modem 512 Kbps to
52 Mbps
Coaxial cable with F
connector.
Home, business, school access
Satellite 400 kbps Satellite Dish Rural and remote areas
Cellular Broadband Up to 2.4
mbps
Cell phone Access on the go.

Additional Notes:
Dial-up networking is fading away with the adoption of faster technologies.
ISDN service is an older, but still viable technology offered by phone companies in some parts of
the U.S... ISDN requires an ISDN adapter instead of a modem, and a phone line with a special
connection that allows it to send and receive digital signals.
ADSL allows you to connect to the internet via your phone line, but allows you to use your phone
while connected to the internet. Unlike a cable modem, the speed is stable.
Cable modems are much faster generally than ADSL; however, your mileage will vary depending
on how many other people are using the bandwidth on your segment.
Satellite connections come in two types - 1-way and 2-way. 1-way satellites only accept signals
and 2-way connections send and receive. Satellite connections can be affected by weather.


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
16
EXPERIMENT NO: 3

TITLE: To study about various networking Devices.

OBJECTIVE: On completion of this exercise student will able to know about
Switch, Hub, Router, Gateway, Repeater, Bridge

THEORY:

Hubs
Hubs are simple network devices, and their simplicity is reflected in their low cost. Small hubs with four
or five ports (often referred to as workgroup hubs) cost less than $50; with the requisite cables, they
provide everything needed to create a small network. Hubs with more ports are available for networks
that require greater capacity. Figure 3.1 shows an example of a workgroup hub, and Figure 3.2 shows an
example of the type of hub you might see on a corporate network.

FIGURE 3.1 A workgroup hub.

FIGURE 3.2 A high-capacity, or highdensity, hub.

Computers connect to a hub via a length of twisted-pair cabling. In addition to ports for connecting
computers, even an inexpensive hub generally has a port designated as an uplink port that enables the hub
to be connected to another hub to create larger networks. The Working with Hubs and Switches section
later in this chapter presents a detailed discussion of this feature.

Gandhinagar Institute of Technology Computer Network 150702
17
Most hubs are referred to as either active or passive. Active regenerate a signal before forwarding it to all
the ports on the device and requires a power supply. Small workgroup hubs normally use an external
power adapter, but on larger units the power supply is built in. Passive hubs, which today are seen only
on older networks, do not need power and they dont regenerate the data signal.

Regeneration of the signal aside, the basic function of a hub is to take data from one of the connected
devices and forward it to all the other ports on the hub. This method of operation is inefficient because, in
most cases, the data is intended for only one of the connected devices. You can see a representation of
how a hub works in Figure 3.3.


FIGURE 3.3 How a hub works.
Due to the inefficiencies of the hub system and the constantly increasing demand for more bandwidth,
hubs are slowly but surely being replaced with switches. As you will see in the next section, switches
offer distinct advantages over hubs.

Switches
On the surface, a switch looks much like a hub. Despite their similar appearance, switches are far more
efficient than hubs and are far more desirable for todays network environments. Figure 3.4 shows an
example of a 32-port Ethernet switch. If you refer to Figure 3.2, youll notice few differences in the
appearance of the high-density hub and this switch.



FIGURE 3.4 A 32-port Ethernet switch. (Photo courtesy TREND ware International.)

As with a hub, computers connect to a switch via a length of twisted-pair cable. Multiple switches are
often interconnected to create larger networks. Despite their similarity in appearance and their identical
physical connections to computers, switches offer significant operational advantages over hubs.

Gandhinagar Institute of Technology Computer Network 150702
18
As discussed earlier in the chapter, a hub forwards data to all ports, regardless of whether the data is
intended for the system connected to the port. This arrangement is inefficient; however, it requires little
intelligence on the part of the hub, which is why hubs are inexpensive.

Rather than forwarding data to all the connected ports, a switch forwards data only to the port on which
the destination system is connected. It looks at the Media Access Control (MAC) addresses of the devices
connected to it to determine the correct port. A MAC address is a unique number that is stamped into
every NIC. By forwarding data only to the system to which the data is addressed, the switch decreases the
amount of traffic on each network link dramatically. In effect, the switch literally channels (or switches, if
you prefer) data between the ports. Figure 3.5 illustrates how a switch works.

FIGURE 3.5 How a switch works.

You might recall from the discussions of Ethernet networking in Chapter 2, Cabling Standards, Media,
and Connectors, that collisions occur on the network when two devices attempt to transmit at the same
time. Such collisions cause the performance of the network to degrade. By channeling data only to the
connections that should receive it, switches reduce the number of collisions that occur on the network. As
a result, switches provide significant performance improvements over hubs.

Switches can also further improve performance over the performance of hubs by using a mechanism
called full-duplex. On a standard network connection, the communication between the system and the
switch or hub is said to be half-duplex. In a half-duplex connection, data can be either sent or received on
the wire but not at the same time. Because switches manage the data flow on the connection, a switch can
operate in full-duplex modeit can send and receive data on the connection at the same time. In a full-
duplex connection, the maximum data throughput is double that for a half-duplex connectionfor
example, 10Mbps becomes 20Mbps, and 100Mbps becomes 200Mbps. As you can imagine, the
difference in performance between a 100Mbps network connection and a 200Mbps connection is
considerable.

The secret of full-duplex lies in the switch. As discussed previously in this section, switches can isolate
each port and effectively create a single segment for each port on the switch. Because only two devices
are on each segment (the system and the switch), and because the switch is calling the shots, there are no
collisions. No collisions means no need to detect collisions thus, a collision-detection system is not
needed with switches. The switch drops the conventional carrier-sense multiple-access with collision
detection (CSMA/CD) media access method and adopts a far more selfish (and therefore efficient)
communication method.

Bridges
Bridges are networking devices that connect networks. Sometimes it is necessary to divide networks into
subnets to reduce the amount of traffic on each larger subnet or for security reasons. Once divided, the
Gandhinagar Institute of Technology Computer Network 150702
19
bridge connects the two subnets and manages the traffic flow between them. Today, network switches
have largely replaced bridges. A bridge functions by blocking or forwarding data, based on the
destination MAC address written into each frame of data. If the bridge believes the destination address is
on a network other than that from which the data was received, it can forward the data to the other
networks to which it is connected. If the address is not on the other side of the bridge, the data is blocked
from passing. Bridges learn the MAC addresses of devices on connected networks by listening to
network traffic and recording the network from which the traffic originates. Figure 3.9 shows a
representation of a bridge.

The advantages of bridges are simple and significant. By preventing unnecessary traffic from crossing
onto other network segments, a bridge can dramatically reduce the amount of network traffic on a
segment. Bridges also make it possible to isolate a busy network from a not-so-busy one, thereby
preventing pollution from busy nodes.

FIGURE 3.9 How a bridge works.

Bridge Implementation Considerations
Although implementing bridges can offer huge improvements in performance, you must factor in a
number of considerations. The first is bridge placement. Generally, you should follow the 80/20 rule for
bridge placement: 80% of the traffic should not cross the bridge, and 20% of the traffic should be on the
other side of the bridge. The rule is easy to understand, but accurately determining the correct location for
the bridge to accommodate the rule is another matter.

Another, potentially more serious, consideration is bridging loops, which can be created when more than
one bridge is used on a network. Multiple bridges can provide fault tolerance or improve performance.
Bridging loops occur when multiple bridges become confused about where devices are on the network.

As an example of bridging loops, imagine that you have a network with two bridges, as depicted in Figure
3.10. During the learning process, the north bridge receives a packet from Interface A (step 1 in Figure
3.11) and determines that it is for a system that is not on Network Z; therefore, the bridge forwards the
packet to Network X (step 2 in Figure 3.11). Now, the south bridge sees a packet originating on Network
X on Interface C (step 3 in Figure 3.11); because it thinks the destination system is not on Network X, it
forwards the packet to Network Z (step 4 in Figure 3.11), where the north bridge picks it up (step 5 in
Figure 3.11). The north bridge determines that the destination system is not on Network Z, so it forwards
the packet to Network Xand the whole process begins again. You can work around the looping problem
by using the Spanning Tree Algorithm (STA).

Gandhinagar Institute of Technology Computer Network 150702
20
When STA is used, each interface on a bridge is assigned a value. As the bridge forwards the data, the
value is attached to the packet. When another bridge sees the data, if the STA value for the interface is
higher than that assigned to its interfaces, the bridge doesnt forward the data, thus eliminating the
possibility of a bridging loop. STA eliminates the bridging loop but still provides the fault tolerance of
having more than one bridge in place. If the bridge with the higher STA value (sometimes referred to as
the primary bridge) fails, the other bridge continues functioning because it becomes the bridge with the
higher STA value. All this is achieved by the Spanning Tree Protocol (STP).

FIGURE 3.10 A network with two bridges.

FIGURE 3.11 A bridging loop.

Routers
Routers are an increasingly common sight in any network environment, from a small home office that
uses one to connect to an Internet service provider (ISP) to a corporate IT environment where racks of
routers manage data communication with disparate remote sites.

Routers make internetworking possible, and in view of this, they warrant detailed attention. Routers are
network devices that literally route data around the network. By examining data as it arrives, the router
can determine the destination address for the data; then, by using tables of defined routes, the router
determines the best way for the data to continue its journey.
Gandhinagar Institute of Technology Computer Network 150702
21
Unlike bridges and switches, which use the hardware-configured MAC address to determine the
destination of the data, routers use the software-configured network address to make decisions. This
approach makes routers more functional than bridges or switches, and it also makes them more complex
because they have to work harder to determine the information. Figure 3.12 shows basically how a router
functions.

The basic requirement for a router is that it must have at least two network interfaces. If they are LAN
interfaces, the router can manage and route the information between two LAN segments. More
commonly, a router is used to provide connectivity across wide area network (WAN) links. Figure 3.13
shows a router with two LAN ports (marked AUI 0 and AUI 1) and two WAN ports (marked Serial 0 and
Serial 1). This router is capable of routing data between two LAN segments and two WAN segments.

FIGURE 3.12 The basic function of a router.


Gandhinagar Institute of Technology Computer Network 150702
22
Gateways
The term gateway is applied to any device, system, or software application that can perform the function
of translating data from one format to another. The key feature of a gateway is that it converts the format
of the data, not the data itself.

You can use gateway functionality in many ways. For example, a router that can route data from an IPX
network to an IP network is, technically, a gateway. The same can be said of a translational bridge that, as
described earlier in this chapter, converts from an Ethernet network to a Token Ring network and back
again.

Software gateways can be found everywhere. Many companies use an email system such as Microsoft
Exchange or Novell GroupWise. These systems transmit mail internally in a certain format. When email
needs to be sent across the Internet to users using a different email system, the email must be converted to
another format, usually to Simple Mail Transfer Protocol (SMTP). This conversion process is performed
by a software gateway. Another good (and often used) example of a gateway involves the Systems
Network Architecture (SNA) gateway, which converts the data format used on a PC to that used on an
IBM mainframe or minicomputer. A system that acts as an SNA gateway sits between the client PC and
the mainframe and translates requests and replies from both directions. Figure 3.15 shows how this would
work in a practical implementation.


FIGURE 3.15 An SNA gateway.

If it seems from the text in this section that we are being vague about what a gateway is, its because there
is no definite answer. The function of a gateway is very specific, but how the gateway functionality is
implemented is not. No matter what their use, gateways slow the flow of data and can therefore
potentially become bottlenecks. The conversion from one data format to another takes time, and so the
flow of data through a gateway is always slower than the flow of data without one.

Modems
Modem is a contraction of the terms modulator and demodulator. Modems perform a simple function:
They translate digital signals from a computer into analog signals that can travel across conventional
phone lines. The modem modulates the signal at the sending end and demodulates at the receiving end.
Gandhinagar Institute of Technology Computer Network 150702
23
Modems provide a relatively slow method of communication. In fact, the fastest modem available on the
market today has a maximum speed of 56Kbps. Compare that to the speed of a 10Mbps network
connection, and youll find that the modem is approximately 180 times slower. That makes modems okay
for browsing web pages or occasionally downloading small files but wholly unsuitable for downloading
large files. As a result, many people prefer to use other remote access methods, including ISDN (which is
discussed later in this chapter, in the section ISDN Terminal Adapters) and cable/DSL access.

Modems are available as internal devices that plug into expansion slots in a system; external devices that
plug into serial or USB ports; PCMCIA cards designed for use in laptops; and specialized devices
designed for use in systems such as handheld computers. In addition, many laptops now come with
integrated modems. For large-scale modem implementations, such as at an ISP, rack-mounted modems
are also available. Figure 3.17 shows an internal modem and a PCMCIA modem.


Network I nterface Cards (NI Cs)
NICssometimes called network cardsare the mechanisms by which computers connect to a network.
NICs come in all shapes and sizes, and they come in prices to suit all budgets. Consider the following
when buying a NIC:
1. Network compatibilityPerhaps this is a little obvious, but sometimes people order the wrong
type of NIC for the network. Given the prevalence of Ethernet networks, you are likely to have to
specify network compatibility only when buying a NIC for another networking system.
2. Bus compatibilityNewly purchased NICs will almost certainly use the Peripheral Component
Interconnect (PCI) bus, although if you are replacing a card in an older system, you might have to
specify an Industry Standard Architecture (ISA) bus card instead. If the card you are buying is
PCI, check to see what kind of PCI interface is being used. Many high-end server systems now
come with 64-bit PCI slots; if you have them, it is definitely worth taking advantage of the extra
performance they offer. Such 64-bit PCI slots can be easily identified because they are the same
color and width as 32-bit PCI slots but are longer. 64-bit slots are referred to as PCI-X and are
backward compatible with 32-bit PCI. Figure 3.18 shows 32-bit PCI slots on a system board.
3. Port compatibilityGenerally a NIC has only one port, for twisted-pair cabling. If you want
some other connectivity, you need to be sure to specify your card accordingly; for example, you
might need a fiber-optic or coaxial cable port.
4. Hardware compatibilityBefore installing a network card into a system, you must verify
compatibility between the network card and the operating system on the PC in which you are
installing the NIC. If you are using good-quality network cards from a recognized manufacturer,
such verification should be little more than a formality.

Repeaters
As signals travel along a network cable (or any other medium of transmission), they degrade and become
distorted in a process that is called attenuation. If a cable is long enough, the attenuation will finally make
a signal unrecognizable by the receiver.
A Repeater enables signals to travel longer distances over a network. Repeaters work at the OSI's
Physical layer. A repeater regenerates the received signals and then retransmits the regenerated (or
conditioned) signals on other segments.
Gandhinagar Institute of Technology Computer Network 150702
24


To pass data through the repeater in a usable fashion from one segment to the next, the packets and the
Logical Link Control (LLC) protocols must be the same on the each segment. This means that a repeater
will not enable communication, for example, between an 802.3 segment (Ethernet) and an 802.5 segment
(Token Ring). That is, they cannot translate an Ethernet packet into a Token Ring packet. In other words,
repeaters do not translate anything.


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
25
EXPERIMENT NO: 4

TITLE: To demonstrate how to connect the computers in Local Area Network.

OBJECTIVE: On completion of this exercise student will able to know about How to Make a
Network Cable


THEORY:

How to Make a Network Cable
The steps below are general Ethernet Category 5 (commonly known as Cat 5) cable construction
guidelines. For our example, we will be making a Category 5e patch cable, but the same general method
will work for making any category of network cables.

1. Unroll the required length of network cable and add a little extra wire, just in case. If a boot
is to be fitted, do so before stripping away the sleeve and ensure the boot faces the correct way.

2. Carefully remove the outer jacket of the cable. Be careful when stripping the jacket as to not
nick or cut the internal wiring. One good way to do this is to cut lengthwise with snips or a knife
along the side of the cable, away from yourself, about an inch toward the open end. This reduces
the risk of nicking the wires' insulation. Locate the string inside with the wires, or if no string is
found, use the wires themselves to unzip the sheath of the cable by holding the sheath in one hand
and pulling sideways with the string or wire. Cut away the unzipped sheath and cut the twisted
pairs about 1 1/4" (30 mm). You will notice 8 wires twisted in 4 pairs. Each pair will have one
wire of a certain color and another wire that is white with a colored stripe matching its partner
(this wire is called a tracer).


3. Inspect the newly revealed wires for any cuts or scrapes that expose the copper wire inside.
If you have breached the protective sheath of any wire, you will need to cut the entire segment of
wires off and start over at step one. Exposed copper wire will lead to cross-talk, poor performance
or no connectivity at all. It is important that the jacket for all network cables remains intact.


Gandhinagar Institute of Technology Computer Network 150702
26
4. Untwist the pairs so they will lay flat between your fingers. The white piece of thread can be
cut off even with the jacket and disposed (see Warnings). For easier handling, cut the wires so
that they are 3/4" (19 mm) long from the base of the jacket and even in length.


5. Arrange the wires based on the wiring specifications you are following. There are two
methods set by the TIA, 568A and 568B. Which one you use will depend on what is being
connected. A straight-through cable is used to connect two different-layer devices (e.g. a hub and
a PC). Two like devices normally require a cross-over cable. The difference between the two is
that a straight-through cable has both ends wired identically with 568B, while a cross-over cable
has one end wired 568A and the other end wired 568B.For our demonstration in the following
steps, we will use 568B, but the instructions can easily be adapted to 568A.
568B - Put the wires in the following order, from left to right:
a. white orange
b. orange
c. white green
d. blue
e. white blue
f. green
g. white brown
h. brown
568A - from left to right:
i. white/green
j. green
k. white/orange
l. blue
m. white/blue
n. orange
o. white/brown
p. brown


6. Press all the wires flat and parallel between your thumb and forefinger. Verify the colors
have remained in the correct order. Cut the top of the wires even with one another so that they are
1/2" (12.5 mm) long from the base of the jacket, as the jacket needs to go into the 8P8C connector
by about 1/8", meaning that you only have a 1/2" of room for the individual cables. Leaving more
than 1/2" untwisted can jeopardize connectivity and quality. Ensure that the cut leaves the wires
Gandhinagar Institute of Technology Computer Network 150702
27
even and clean; failure to do so may cause the wire not to make contact inside the jack and could
lead to wrongly guided cores inside the plug.


7. Keep the wires flat and in order as you push them into the RJ-45 plug with the flat surface
of the plug on top. The white/orange wire should be on the left if you're looking down at the
jack. You can tell if all the wires made it into the jack and maintain their positions by looking
head-on at the plug. You should be able to see a wire located in each hole, as seen at the bottom
right. You may have to use a little effort to push the pairs firmly into the plug. The cabling jacket
should also enter the rear of the jack about 1/4" (6 mm) to help secure the cable once the plug is
crimped. You may need to stretch the sleeve to the proper length. Verify that the sequence is still
correct before crimping.



8. Place the wired plug into the crimping tool. Give the handle a firm squeeze. You should hear a
ratcheting noise as you continue. Once you have completed the crimp, the handle will reset to the
open position. To ensure all pins are set, some prefer to double-crimp by repeating this step.
Gandhinagar Institute of Technology Computer Network 150702
28


9. Repeat all of the above steps with the other end of the cable. The way you wire the other end
(568A or 568B) will depend on whether you're making a straight-through, rollover, or cross-over
cable (see Tips).

10. Test the cable to ensure that it will function in the field. Mis-wired and incomplete network
cables could lead to headaches down the road. In addition, with power-over-Ethernet (PoE)
making its way into the market place, crossed wire pairs could lead to physical damage of
computers or phone system equipment, making it even more crucial that the pairs are in the
correct order. A simple cable tester can quickly verify that information for you. Should you not
have a network cable tester on hand, simply test connectivity pin to pin.


Straight Cable
You usually use straight cable to connect different type of devices. This type of cable will be used most of
the time and can be used to:
1. Connect a computer to a switch/hub's normal port.
2. Connect a computer to a cable/DSL modem's LAN port.
3. Connect a router's WAN port to a cable/DSL modem's LAN port.
4. Connect a router's LAN port to a switch/hub's uplink port. (normally used for expanding network)
5. Connect 2 switches/hubs with one of the switch/hub using an uplink port and the other one using
normal port.

If you need to check how straight cable looks like, it's easy. Both side (side A and side B) of cable have
wire arrangement with same color.
Gandhinagar Institute of Technology Computer Network 150702
29

Crossover Cable
Sometimes you will use crossover cable, it's usually used to connect same type of devices. A crossover
cable can be used to:
1. Connect 2 computers directly.
2. Connect a router's LAN port to a switch/hub's normal port. (normally used for expanding
network)
3. Connect 2 switches/hubs by using normal port in both switches/hubs.

In you need to check how crossover cable looks like, both side (side A and side B) of cable have wire
arrangement with following different color. Have a look on these crossover cables if you plan to buy
one.
Gandhinagar Institute of Technology Computer Network 150702
30


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
31
EXPERIMENT NO: 5

TITLE: To study about OSI Reference model and TCP/IP model with their differences.

OBJECTIVE: On completion of this exercise student will able to know about


THEORY:
Open Systems Interconnection ( OSI ) is a standard reference model for communication between two end
users in a network. The model is used in developing products and understanding networks. Also see the
notes below the figure.

OSI divides telecommunication into seven layers. The layers are in two groups. The upper four layers are
used whenever a message passes from or to a user. The lower three layers are used when any message
passes through the host computer. Messages intended for this computer pass to the upper layers.
Messages destined for some other host are not passed up to the upper layers but are forwarded to another
host. The seven layers are:

Layer 7: The application layer ...This is the layer at which communication partners are identified,
quality of service is identified, user authentication and privacy are considered, and any constraints on data
syntax are identified. (This layer is not the application itself, although some applications may perform
application layer functions.)
Gandhinagar Institute of Technology Computer Network 150702
32
Layer 6: The presentation layer ...This is a layer, usually part of an operating system, that converts
incoming and outgoing data from one presentation format to another (for example, from a text stream into
a popup window with the newly arrived text). Sometimes called the syntax layer.

Layer 5: The session layer ...This layer sets up, coordinates, and terminates conversations, exchanges,
and dialogs between the applications at each end. It deals with session and connection coordination.

Layer 4: The transport layer ...This layer manages the end-to-end control (for example, determining
whether all packets have arrived) and error-checking. It ensures complete data transfer.

Layer 3: The network layer ...This layer handles the routing of the data (sending it in the right direction
to the right destination on outgoing transmissions and receiving incoming transmissions at the packet
level). The network layer does routing and forwarding.

Layer 2: The data-link layer ...This layer provides synchronization for the physical level and does bit-
stuffing for strings of 1's in excess of 5. It furnishes transmission protocol knowledge and management.

Layer 1: The physical layer ...This layer conveys the bit stream through the network at the electrical and
mechanical level. It provides the hardware means of sending and receiving data on a carrier.

Transmission Control Protocol/Internet Protocol (TCP/IP) protocol suite is the engine for the Internet
and networks worldwide. Its simplicity and power has led to its becoming the single network protocol of
choice in the world today. TCP/IP is a set of protocols developed to allow cooperating computers to share
resources across the network.

TCP/IP Model
This model was initially developed & used by ARPANET (Advanced Research Project Agency
Network). ARPANET was a community of researchers sponsored by the U.S. department of
defense. It connects many universities and government installations using leased telephone lines
.Certainly the ARPAnet is the best- known TCP/IP network.
The most accurate name for the set of protocols is the "Internet protocol suite". TCP and IP are two of the
protocols in this suite. The Internet is a collection of networks. Term "Internet" applies to this entire set of
networks. Like most networking software, TCP/IP is modeled in layers. This layered representation leads
to the term protocol stack, which refers to the stack of layers in the protocol suite. It can be used for
positioning the TCP/IP protocol suite against others network software like Open System Interconnection
(OSI) model.
By dividing the communication software into layers, the protocol stack allows for division of labor, ease
of implementation and code testing, and the ability to develop alternative layer implementations. Layers
communicate with those above and below via concise interfaces. In this regard, a layer provides a service
for the layer directly above it and makes use of services provided by the layer directly below it. For
example, the IP layer provides the ability to transfer data from one host to another without any guarantee
to reliable delivery or duplicate suppression.
Gandhinagar Institute of Technology Computer Network 150702
33

TCP/IP is a family of protocols. A few provide "low- level" functions needed for many applications.
These include IP, TCP, and UDP. Others are protocols for doing specific tasks, e.g. transferring files
between computers, sending mail, or finding out who is logged in on another computer. Initially TCP/IP
was used mostly between minicomputers or mainframes. These machines had their own disks, and
generally were self contained.

Application Layer
The application layer is provided by the program that uses TCP/IP for communication. An application is a
user process cooperating with another process usually on a different host (there is also a benefit to
application communication within a single host). Examples of applications include Telnet and the File
Transfer Protocol (FTP).

Transport Layer
The transport layer provides the end-to-end data transfer by delivering data from an application to its
remote peer. Multiple applications can be supported simultaneously. The most-used transport layer
protocol is the Transmission Control Protocol (TCP), which provides connection-oriented reliable data
delivery, duplicate data suppression, congestion control, and flow control.

Another transport layer protocol is the User Datagram Protocol It provides connectionless, unreliable,
best-effort service. As a result, applications using UDP as the transport protocol have to provide their own
end-to-end integrity, flow control, and congestion control, if desired. Usually, UDP is used by
applications that need a fast transport mechanism and can tolerate the loss of some data.

Internetwork Layer
The internetwork layer, also called the internet layer or the network layer, provides the virtual network
image of an internet this layer shields the higher levels from the physical network architecture below it.
Internet Protocol (IP) is the most important protocol in this layer. It is a connectionless protocol that does
not assume reliability from lower layers. IP does not provide reliability, flow control, or error recovery.
These functions must be provided at a higher level. IP provides a routing function that attempts to deliver
transmitted messages to their destination. A message unit in an IP network is called an IP datagram.

This is the basic unit of information transmitted across TCP/IP networks. Other internetwork-layer
protocols are IP, ICMP, IGMP, ARP, and RARP.


Gandhinagar Institute of Technology Computer Network 150702
34
Network Interface Layer
The network interface layer, also called the link layer or the data-link layer or Host to Network Layer, is
the interface to the actual network hardware. This interface May or may not provide reliable delivery, and
may be packet or stream oriented.

In fact, TCP/IP does not specify any protocol here, but can use almost any network interface available,
which illustrates the flexibility of the IP layer. Examples are IEEE 802.2, X.25, ATM, FDDI, and even
SNA.TCP/IP specifications do not describe or standardize any network-layer protocols, they only
standardize ways of accessing those protocols from the internet work layer.




EXCERSICE:

1) Write Different Between OSI VS TCP/IP Model.
2) Explain Connectionless vs. Connection oriented Protocol.


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
35
EXPERIMENT NO: 6

TITLE: To demonstrate different Networking Commands (ping, Traceroute, pathping,
Date, Netstat etc.)

OBJECTIVE: On completion of this exercise student will able to know about different
Networking Commands

THEORY:

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 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.
Ping Command Syntax
Syntax:
ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [-w timeout] [-R] [-S
srcaddr] [-4] [-6] target [/?]
Example: ping t 10.1.1.1

Ipconfig/Ifconfig:
ipconfig (internet protocol configuration) in Microsoft Windows is a console application that
displays all current TCP/IP network configuration values and can modify Dynamic Host
Configuration Protocol DHCP and Domain Name System DNS settings.
Example: ipconfig/all

Ifconfig (short for interface configuration) is a system administration utility in UNIX (Linux)-
like operating systems to configure, control, and query TCP/IP network interface parameters
from a command line interface (CLI) or in system configuration scripts.
Example: ifconfig/all

nslookup:
This command helps to diagnose the Domain Name System (DNS) infrastructure and comes
with a number of sub-commands. Usually used by hackers to find out some useful information
that you cant find on search engine. In this tips and trick Im only show you how to find server
IP address or host name. Type nslookup and the enter the URL of website you want to know its
IP address for example I use google.com.
Example: nslookup www.google.com

Gandhinagar Institute of Technology Computer Network 150702
36
Tracert:
Tracert (traceroute) is another command adopted from UNIX system. Actually when you try to
open facebook.com or google.com in your browser, you ask your computer to go to that address
through hopping into a few router addresses. Lets see the picture below when Im trying to
traceroute to google.com (sorry if I put a lot of sensor in these pics).
Example tracert www.google.com

Netstat:
Netstat displays the active TCP connections and ports on which the computer is listening,
Ethernet statistics, the IP routing table, statistics for the IP, ICMP, TCP, and UDP protocols.
Netstat also can be used to tracking your outbound or inbound connection to your computer;
its useful to malicious connection. Lets see the picture below to see the available switch in
netstat.

Hostname: Display Host Name
Net: Used To Start, Stop, and View Many Networking Operations
Route: Manipulates Tcp/Ip Routing Information
Getmac: Lists the Mac (Media Access Control) Address On the Computer Network Interfaces
Arp: Displays or Modifies Information in the Arp (Address Resolution Protocol) Cache
Pathping:
Pathping Is An Ms-Dos Utility Available For Microsoft Windows 2000 And Windows Xp Users.
This Utility Enables A User to Find Network Latency And Network Loss.
Netstat:
The Nbtstat MS-DOS Utility that Displays Protocol Statistics And Current Tcp/Ip Connections
Using Nbt.
Telnet: Used for Remote Login.
Ftp: Use for File Transfer.


EXCERSICE:

1) Write Output of this all Network Command.


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________ Date: ________________


Gandhinagar Institute of Technology Computer Network 150702
37
EXPERIMENT NO: 7

TITLE: To study about various socket calls.

OBJECTIVE: On completion of this exercise student will able to know about Network socket
calls

THEORY:

Client Server Architecture
In the client server architecture, a machine (referred as client) makes a request to connect to another
machine (called as server) for providing some service. The services running on the server run on known
ports (application identifiers) and the client needs to know the address of the server machine and this
port in order to connect to the server. On the other hand, the server does not need to know about the
address or the port of the client at the time of connection initiation. The first packet which the client
sends as a request to the server contains this informations about the client which are further used by
the server to send any information. Client acts as the active device which makes the first move to
establish the connection whereas the server passively waits for such requests from some client.

Illustration of Client Server Model
What is a Socket?
In UNIX, whenever there is a need for inter process communication within the same machine, we use
mechanism like signals or pipes (named or unnamed). Similarly, when we desire a communication
between two applications possibly running on different machines, we need sockets. Sockets are treated
as another entry in the UNIX open file table. So all the system calls which can be used for any IO in UNIX
can be used on socket. The server and client applications use various system calls to connect which use
the basic construct called socket. A socket is one end of the communication channel between two
applications running on different machines.

Gandhinagar Institute of Technology Computer Network 150702
38
Steps followed by client to establish the connection:
1. Create a socket
2. Connect the socket to the address of the server
3. Send/Receive data
4. Close the socket
Steps followed by server to establish the connection:
1. Create a socket
2. Bind the socket to the port number known to all clients
3. Listen for the connection request
4. Accept connection request
5. Send/Receive data
Sequence of System Calls for Connection Oriented communication
The typical set of system calls on both the machines in a connection-oriented setup is shown in Figure
below.





Gandhinagar Institute of Technology Computer Network 150702
39
EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
40
EXPERIMENT NO: 8

TITLE: Write a program to implement the data link layer framing method like the concept of
bit stuffing.

OBJECTIVE: On completion of this exercise student will able to know about bit stuffing.

THEORY:

Each frame begins and ends with a special bit pattern called a flag byte [01111110].
{Note this is 7E in hex}

Whenever sender data link layer encounters five consecutive ones in the data stream, it
automatically stuffs a 0 bit into the outgoing stream.

When the receiver sees five consecutive incoming ones followed by a 0 bit, it automatically
dyestuffs the 0 bit before sending the data to the network layer

To prevent data being interpreted as control information. For example, many frame-based
protocols, such as X.25, signal the beginning and end of a frame with six consecutive 1 bits.
Therefore, if the actual data being transmitted has six 1 bits in a row, a zero is inserted after the
first 5 so that the dat is not interpreted as a frame delimiter. Of course, on the receiving end, the
stuffed bits must be discarded.

For protocols that require a fixed-size frame, bits are sometimes inserted to make the frame size
equal to this set size.

For protocols that required a continuous stream of data, zero bits are sometimes inserted to
ensure that the stream is not broken.



Gandhinagar Institute of Technology Computer Network 150702
41
EXCERSICE:

1) Perform Bit Staffing Using C Program.


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
42
EXPERIMENT NO: 9

TITLE: Write a program to implement the data link layer framing method like the
concept of character stuffing.

OBJECTIVE: On completion of this exercise student will able to know about byte staffing.

THEORY:

In character-oriented protocol, we add special characters (called flag) to distinguish beginning
and end of a frame. Usually flag has 8-bit length. The character-oriented protocols are popular
only with text data. While using characteroriented protocol another problem is arises, pattern
used for the flag may also part of the data to send. If this happens, the destination node, when it
encounters this pattern in the middle of the data, assumes it has reached the end of the frame.

To deal with this problem, a byte stuffing (known as character stuffing) approach was
included to character-oriented protocol. In byte stuffing a special byte is add to the data part, this
is known as escape character (ESC). The escape characters have a predefined pattern. The
receiver removes the escape character and keeps the data part. It cause to another problem, if the
text contains escape characters as part of data. To deal with this, an escape character is prefixed
with another escape character. The following figure explains everything we discussed about
character stuffing.



Gandhinagar Institute of Technology Computer Network 150702
43
EXCERSICE:

2) Perform Byte Staffing Using C Program.


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
44
EXPERIMENT NO: 10

TITLE: To demonstrate how to install Packet Tracer and implementation of Network
Topology using Packet Tracer.

OBJECTIVE: On completion of this exercise student will able to know about


THEORY:

Cisco Packet Tracer is a network simulation program that allows students to experiment with network
behavior and ask what if questions. As an integral part of the Networking Academy comprehensive
learning experience, Packet Tracer provides simulation, visualization, authoring, assessment, and
collaboration capabilities and facilitates the teaching and learning of complex technology concepts.





Gandhinagar Institute of Technology Computer Network 150702
45

EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Gandhinagar Institute of Technology Computer Network 150702
46
EXPERIMENT NO: 11

TITLE: To Study of Network IP Address. (Classification of IP address, Sub netting,
Super netting and Masking)

OBJECTIVE: On completion of this exercise student will able to know about


THEORY:

Definitions are helpful to you, use these vocabulary terms to get you started:
Addressthe unique number ID assigned to one host or interface in a network.
Subneta portion of a network sharing a particular subnet addresses.
Subnet maskA 32-bit combination used to describe which portion of an address refers
to the subnet and which part refers to the host.
InterfaceA network connection.
Understanding IP Addresses
An IP address is an address used in order 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. The 32 binary bits are broken into four octets (1 octet = 8
bits). Each octet is converted to decimal and separated by a period (dot). For this reason, an IP
address is said to be expressed in dotted decimal format (for example, 172.16.81.100). The value
in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary.
Here is how binary octets convert to decimal: The right most bit, or least significant bit, of an
octet holds a value of 2
0
. The bit just to the left of that holds a value of 2
1
. This continues until
the left-most bit, or most significant bit, which holds a value of 2
7
. So if all binary bits are a one,
the decimal equivalent would be 255 as shown here:
1 1 1 1 1 1 1 1
128 64 32 16 8 4 2 1 (128+64+32+16+8+4+2+1=255)
Here is a sample octet conversion when not all of the bits are set to 1.
0 1 0 0 0 0 0 1
0 64 0 0 0 0 0 1 (0+64+0+0+0+0+0+1=65)
And this is sample shows an IP address represented in both binary and decimal.
10. 1. 23. 19 (decimal)
00001010.00000001.00010111.00010011 (binary)
Gandhinagar Institute of Technology Computer Network 150702
47
These octets are broken down to provide an addressing scheme that can accommodate large and
small networks. There are five different classes of networks, A to E. This document focuses on
addressing classes A to C, since classes D and E are reserved and discussion of them is beyond
the scope of this document.
Note: Also note that the terms "Class A, Class B" and so on are used in this document to help
facilitate the understanding of IP addressing and subnetting. These terms are rarely used in the
industry anymore because of the introduction of classless interdomain routing (CIDR).
Given an IP address, its class can be determined from the three high-order bits. Figure 1 shows
the significance in the three high order bits and the range of addresses that fall into each class.
For informational purposes, Class D and Class E addresses are also shown.
Figure 1

In a Class A address, the first octet is the network portion, so the Class A example in Figure 1
has a major network address of 1.0.0.0 - 127.255.255.255. Octets 2, 3, and 4 (the next 24 bits)
are for the network manager to divide into subnets and hosts as he/she sees fit. Class A addresses
are used for networks that have more than 65,536 hosts (actually, up to 16777214 hosts!).
In a Class B address, the first two octets are the network portion, so the Class B example in
Figure 1 has a major network address of 128.0.0.0 - 191.255.255.255. Octets 3 and 4 (16 bits) are
Gandhinagar Institute of Technology Computer Network 150702
48
for local subnets and hosts. Class B addresses are used for networks that have between 256 and
65534 hosts.
In a Class C address, the first three octets are the network portion. The Class C example in
Figure 1 has a major network address of 192.0.0.0 - 223.255.255.255. Octet 4 (8 bits) is for local
subnets and hosts - perfect for networks with less than 254 hosts.
Network Masks
A network mask helps you know which portion of the address identifies the network and which
portion of the address identifies the node. Class A, B, and C networks have default masks, also
known as natural masks, as shown here:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
An IP address on a Class A network that has not been subnetted would have an address/mask
pair similar to: 8.20.15.1 255.0.0.0. To see how the mask helps you identify the network and
node parts of the address, convert the address and mask to binary numbers.
8.20.15.1 = 00001000.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
Once you have the address and the mask represented in binary, then identifying the network and
host ID is easier. Any address bits which have corresponding mask bits set to 1 represent the
network ID. Any address bits that have corresponding mask bits set to 0 represent the node ID.
8.20.15.1 = 00001000.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
-----------------------------------
net id | host id

netid = 00001000 = 8
hostid = 00010100.00001111.00000001 = 20.15.1
Understanding Subnetting
Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or
C network. If you do not subnet, you are only able to use one network from your Class A, B, or
C network, which is unrealistic.
Each data link on a network must have a unique network ID, with every node on that link being a
member of the same network. If you break a major network (Class A, B, or C) into smaller
subnetworks, it allows you to create a network of interconnecting subnetworks. Each data link on
this network would then have a unique network/subnetwork ID. Any device, or gateway,
connecting n networks/subnetworks has n distinct IP addresses, one for each network /
subnetwork that it interconnects.
Gandhinagar Institute of Technology Computer Network 150702
49
In order to subnet a network, extend the natural mask using some of the bits from the host ID
portion of the address to create a subnetwork ID. For example, given a Class C network of
204.17.5.0 which has a natural mask of 255.255.255.0, you can create subnets in this manner:
204.17.5.0 - 11001100.00010001.00000101.00000000
255.255.255.224 - 11111111.11111111.11111111.11100000
--------------------------|sub|----
By extending the mask to be 255.255.255.224, you have taken three bits (indicated by "sub")
from the original host portion of the address and used them to make subnets. With these three
bits, it is possible to create eight subnets. With the remaining five host ID bits, each subnet can
have up to 32 host addresses, 30 of which can actually be assigned to a device since host ids of
all zeros or all ones are not allowed (it is very important to remember this). So, with this in
mind, these subnets have been created.
204.17.5.0 255.255.255.224 host address range 1 to 30
204.17.5.32 255.255.255.224 host address range 33 to 62
204.17.5.64 255.255.255.224 host address range 65 to 94
204.17.5.96 255.255.255.224 host address range 97 to 126
204.17.5.128 255.255.255.224 host address range 129 to 158
204.17.5.160 255.255.255.224 host address range 161 to 190
204.17.5.192 255.255.255.224 host address range 193 to 222
204.17.5.224 255.255.255.224 host address range 225 to 254


EVALUATION:

Observation &
Implementation
Timely completion Viva Total
4 2 4 10




Signature: ____________


Date: ________________

Potrebbero piacerti anche