You are on page 1of 49

COMPUTER ARCHITECTURE

LAB FILE

RUBAL SHARMA | B. TECH CSE SEMESTER 4 | 1819001005


INDEX
AIM: Study of Network topology with introduction to Network lab.

POINT TO POINT

Point-to-point topology is the easiest of all the network topologies. In this method, the network consists of a direct link
between two computers.

P2P Topology Diagram

Advantages:

 This is faster and highly reliable than other types of connections since there is a direct connection.
 No need for a network operating system
 Does not need an expensive server as individual workstations are used to access the files
 No need for any dedicated network technicians because each user sets their permissions

Disadvantages:

 The biggest drawback is that it only be used for small areas where computers are in close proximity.
 You can't back up files and folders centrally
 There is no security besides the permissions. Users often do not require to log onto their workstations.
 Bus Topology

Bus Topology Diagram


Bus topology uses a single cable which connects all the included nodes. The main cable acts as a spine for the entire
network. One of the computers in the network acts as the computer server. When it has two endpoints, it is known as a
linear bus topology.

Advantages:

Here are pros/benefits of using a bus topology:

 Cost of the cable is very less as compared to other topology, so it is widely used to build small networks.
 Famous for LAN network because they are inexpensive and easy to install.
 It is widely used when a network installation is small, simple, or temporary.
 It is one of the passive topologies. So computers on the bus only listen for data being sent, that are not responsible
for moving the data from one computer to others.

Disadvantages:

Here are the cons/drawbacks of bus topology:

 In case if the common cable fails, then the entire system will crash down.
 When network traffic is heavy, it develops collisions in the network.
 Whenever network traffic is heavy, or nodes are too many, the performance time of the network significantly
decreases.
 Cables are always of a limited length.

Ring Topology Ring

Topology Diagram

In a ring network, every device has exactly two neighbouring devices for communication purpose. It is called a ring
topology as its formation is like a ring. In this topology, every computer is connected to another computer. Here, the last
node is combined with a first one.

This topology uses token to pass the information from one computer to another. In this topology, all the messages travel
through a ring in the same direction.

Advantages:

Here are pros/benefits of ring topology:

 Easy to install and reconfigure.


 Adding or deleting a device in-ring topology needs you to move only two connections.
 The troubleshooting process is difficult in a ring topology.
 Failure of one computer can disturb the whole network.
 Offers equal access to all the computers of the networks
 Faster error checking and acknowledgment.

Disadvantages:

Here are drawbacks/cons of ring topology:

 Unidirectional traffic.
 Break in a single ring can risk the breaking of the entire network
 Modern days high-speed LANs made this topology less popular.
 In the ring, topology signals are circulating at all times, which develops unwanted power consumption.
 It is very difficult to troubleshoot the ring network.
 Adding or removing the computers can disturb the network activity.

STAR TOPOLOGY

Star Topology Diagram

In the star topology, all the computers connect with the help of a hub. This cable is called a central node, and all other
nodes are connected using this central node. It is most popular on LAN networks as they are inexpensive and easy to
install.

Advantages:

Here are pros/benefits of start topology:

 Easy to troubleshoot, set up, and modify.


 Only those nodes are affected, that has failed. Other nodes still work.
 Fast performance with few nodes and very low network traffic.
 In Star topology, addition, deletion, and moving of the devices are easy.

Disadvantages:

Here are cons/drawbacks of using Star:

 If the hub or concentrator fails, attached nodes are disabled.


 Cost of installation of star topology is costly.
 Heavy network traffic can sometimes slow the bus considerably.
 Performance depends on the hub's capacity
 A damaged cable or lack of proper termination may bring the network down.
MESH TOPOLOGY

The mesh topology has a unique network design in which each computer on the network connects to every other. It is
develops a P2P (point-to-point) connection between all the devices of the network. It offers a high level of redundancy, so
even if one network cable fails, still data has an alternative path to reach its destination.

Types of Mesh Topology:

 Partial Mesh Topology: In this type of topology, most of the devices are connected almost similarly as full
topology. The only difference is that few devices are connected with just two or three devices.

Partially Connected Mesh Topology

 Full Mesh Topology: In this topology, every nodes or device are directly connected with each other.

Fully Connected Mesh Topology


Advantages:

Here, are pros/benefits of Mesh topology

 The network can be expanded without disrupting current users.


 Need extra capable compared with other LAN topologies.
 Complicated implementation.
 No traffic problem as nodes has dedicated links.
 It has multiple links, so if any single route is blocked, then other routes should be used for data communication.
 P2P links make the fault identification isolation process easy.
 It helps you to avoid the chances of network failure by connecting all the systems to a central node.

Disadvantages:

 Installation is complex because every node is connected to every node.


 Dedicated links help you to eliminate the traffic problem.
 A mesh topology is robust.
 Every system has its privacy and security
 It is expensive due to the use of more cables. No proper utilization of systems.
 It requires more space for dedicated links.
 Because of the amount of cabling and the number of input-outputs, it is expensive to implement.
 It requires a large space to run the cables.

TREE TOPOLOGY

Tree Topology

Tree topologies have a root node, and all other nodes are connected which form a hierarchy. So it is also known as
hierarchical topology. This topology integrates various star topologies together in a single bus, so it is known as a Star Bus
topology. Tree topology is a very common network which is similar to a bus and star topology.

Advantages:

Here are pros/benefits of tree topology:

 Failure of one node never affects the rest of the network.


 Node expansion is fast and easy.
 Detection of error is an easy process
 It is easy to manage and maintain

Disadvantages:

Here are cons/drawback of tree topology:

 It is heavily cabled topology


 If more nodes are added, then its maintenance is difficult
 If the hub or concentrator fails, attached nodes are also disabled.

HYBRID TOPOLOGY

Hybrid Topology
Hybrid topology combines two or more topologies. You can see in the above architecture in such a manner that the
resulting network does not exhibit one of the standard topologies.

For example, as you can see in the above image that in an office in one department, Star and P2P topology is used. A
hybrid topology is always produced when two different basic network topologies are connected.

Advantages:

Here, are advantages/pros using Hybrid topology:

 Offers the easiest method for error detecting and troubleshooting


 Highly effective and flexible networking topology
 It is scalable so you can increase your network size

Disadvantages:

 The design of hybrid topology is complex


 It is one of the costliest processes

HOW TO SELECT A NETWORK TOPOLOGY?

Here are some important considerations for selecting the best topology to create a network in your organization:

 Bus topology is surely least expensive to install a network.


 If you want to use a shorter cable or you planning to expand the network is future, then star topology is the best
choice for you.
 Fully mesh topology is theoretically an ideal choice as every device is connected to every other device.
 If you want to use twisted pair cable for networking, then you should build star topologies.
AIM: STUDY OF NETWORK CABLES AND TOOLS.

COAXIAL CABLE

This cable contains a conductor, insulator, braiding, and sheath. The sheath covers the braiding, braiding covers the
insulation, and the insulation covers the conductor.

The following image shows these components.

Sheath

This is the outer layer of the coaxial cable. It protects the cable from physical damage.

Braided shield

This shield protects signals from external interference and noise. This shield is built from the same metal that is used to
build the core.

Insulation

Insulation protects the core. It also keeps the core separate from the braided-shield. Since both the core and the braided-
shield use the same metal, without this layer, they will touch each other and create a short-circuit in the wire.

Conductor

The conductor carries electromagnetic signals. Based on conductor a coaxial cable can be categorized into two types;
single-core coaxial cable and multi-core coaxial cable.

A single-core coaxial cable uses a single central metal (usually copper) conductor, while a multi-core coaxial cable uses
multiple thin strands of metal wires. The following image shows both types of cable.
Coaxial cables in computer networks

The coaxial cables were not primarily developed for the computer network. These cables were developed for general
purposes. They were in use even before computer networks came into existence. They are still used even their use in
computer networks has been completely discontinued.

At the beginning of computer networking, when there were no dedicated media cables available for computer networks,
network administrators began using coaxial cables to build computer networks.

Because of low-cost and long durability, coaxial cables were used in computer networking for nearly two decades (80s
and 90s). Coaxial cables are no longer used to build any type of computer network.

Specifications of coaxial cables

Coaxial cables have been in use for the last four decades. During these years, based on several factors such as the
thickness of the sheath, the metal of the conductor, and the material used in insulation, hundreds of specifications have
been created to specify the characteristics of coaxial cables.

From these specifications, only a few were used in computer networks. The following table lists them.

Type Ohms AWG Conductor Description


RG- 75 18 Solid copper Used in cable network to provide cable Internet service and cable
6 TV over long distances.
RG- 50 10 Solid copper Used in the earliest computer networks. This cable was used as the
8 backbone-cable in the bus topology. In Ethernet standards, this
cable is documented as the 10base5 Thicknet cable.
RG- 50 24 Several thin This cable is thinner, easier to handle and install than the RG-8
58 strands of cable. This cable was used to connect a system with the backbone-
copper cable. In Ethernet standards, this cable is documented as the
10base2 Thinnet cable.
RG- 75 20 - Solid copper Used in cable networks to provide short-distance service.
59 22

 Coaxial cable uses RG rating to measure the materials used in shielding and conducting cores.
 RG stands for the Radio Guide. Coaxial cable mainly uses radio frequencies in transmission.
 Impedance is the resistance that controls the signals. It is expressed in the ohms.
 AWG stands for American Wire Gauge. It is used to measure the size of the core. The larger the AWG
size, the smaller the diameter of the core wire.

TWISTED-PAIR CABLES
The twisted-pair cable was primarily developed for computer networks. This cable is also known as Ethernet cable.
Almost all modern LAN computer networks use this cable.

This cable consists of color-coded pairs of insulated copper wires. Every two wires are twisted around each other to form
pair. Usually, there are four pairs. Each pair has one solid color and one stripped color wire. Solid colors are blue, brown,
green and orange. In stripped color, the solid color is mixed with the white color.

Based on how pairs are stripped in the plastic sheath, there are two types of twisted-pair cable; UTP and STP.

In the UTP (Unshielded twisted-pair) cable, all pairs are wrapped in a single plastic sheath.

In the STP (Shielded twisted-pair) cable, each pair is wrapped with an additional metal shield, then all pairs are wrapped
in a single outer plastic sheath.

Similarities and differences between STP and UTP cables

 Both STP and UTP can transmit data at 10Mbps, 100Mbps, 1Gbps, and 10Gbps.
 Since the STP cable contains more materials, it is more expensive than the UTP cable.
 Both cables use the same RJ-45 (registered jack) modular connectors.
 The STP provides more noise and EMI resistant than the UTP cable.
 The maximum segment length for both cables is 100 meters or 328 feet.
 Both cables can accommodate a maximum of 1024 nodes in each segment.

The following image shows both types of twisted-pair cable.

To learn how twisted-pair cables are used in the LAN network, you can check this tutorial.

Twisted-pair cabling

This tutorial explains how the twisted-pair cable works and how it is used to connect different networking devices in a
network.

The TIA/EIA specifies standards for the twisted-pair cable. First standards were released in 1991, known as TIA/EIA
568. Since then, these standards have been continually revised to cover the latest technologies and developments of the
transmission media.

The TIA/EIA 568 divides the twisted-pair cable into several categories. The following table lists the most common and
popular categories of the twisted-pair cable.
Category / Maximum Bandwidth/support Ethernet Description
name of the supported signals rate standard
cable speed
Cat 1 1Mbps 1MHz Not used for This cable contains only two pairs (4
data wires). This cable was used in the
telephone network for voice
transmission.
Cat 2 4Mbps 10MHz Token Ring This cable and all further cables have a
minimum of 8 wires (4 pairs). This cable
was used in the token-ring network.
Cat 3 10Mbps 16MHz 10BASE-T This is the first Ethernet cable that was
Ethernet used in LAN networks.
Cat 4 20Mbps 20MHz Token Ring This cable was used in advanced Token-
ring networks.
Cat 5 100Mbps 100MHz 100BASE-T This cable was used in advanced (fast)
Ethernet LAN networks.
Cat 5e 1000Mbps 100MHz 1000BASE-T This cable/category is the minimum
Ethernet requirement for all modern LAN
networks.
Cat 6 10Gbps 250MHz 10GBASE-T This cable uses a plastic core to prevent
Ethernet cross-talk between twisted-pair. It also
uses a fire-resistant plastic sheath.
Cat 6a 10Gbps 500MHz 10GBASE-T This cable reduces attenuation and
Ethernet cross-talk. This cable also potentially
removes the length limit. This is the
recommended cable for all modern
Ethernet LAN networks.
Cat 7 10Gbps 600MHz Not drafted This cable sets a base for further
yet development. This cable uses multiple
twisted-pairs and shields each pair by its
own plastic sheath.

 Cat 1, 2, 3, 4, 5 are outdated and not used in any modern LAN network.
 Cat 7 is still a new technology and not commonly used.
 Cat 5e, 6, 6a are the commonly used twisted-pair cables.

FIBER OPTIC CABLE

This cable consists of core, cladding, buffer, and jacket. The core is made from the thin strands of glass or plastic that can
carry data over the long distance. The core is wrapped in the cladding; the cladding is wrapped in the buffer, and the
buffer is wrapped in the jacket.

 Core carries the data signals in the form of the light.


 Cladding reflects light back to the core.
 Buffer protects the light from leaking.
 The jacket protects the cable from physical damage.
Fiber optic cable is completely immune to EMI and RFI. This cable can transmit data over a long distance at the highest
speed. It can transmit data up to 40 kilometers at the speed of 100Gbps.

Fiber optic uses light to send data. It reflects light from one endpoint to another. Based on how many beams of light are
transmitted at a given time, there are two types of fiber optical cable; SMF and MMF.

SMF (Single-mode fiber) optical cable

This cable carries only a single beam of light. This is more reliable and supports much higher bandwidth and longer
distances than the MMF cable. This cable uses a laser as the light source and transmits 1300 or 1550 nano-meter
wavelengths of light.

MMF (multi-mode fiber) optical cable

This cable carries multiple beams of light. Because of multiple beams, this cable carries much more data than the SMF
cable. This cable is used in shorter distances. This cable uses an LED as the light source and transmits 850 or 1300 nano-
meter wavelengths of light.

That’s all for this tutorial. In the next part of this article, we will understand the types of connectors that are used to
connect cables with networking devices. If you like this tutorial, please don’t forget to share it with friends through your
favorite social channel.

Twisted-pair (STP and UTP) network cable crimping tools

Crimping tools are used for the following purposes.

 To cut the network cable of the required length from the bundle.
 To remove the outer and inner jackets of the network cable.
 To attach the connectors on both ends of the cable.

Some crimping tools provide all the functionality while others provide one or two functionalities. The most common
twisted-pair network cable crimping tools are described below.

Wire Cutter: - To cut the network cable of the required length from the bundle, you can use any standard wire cutter tool
or can use a wire cutter tool that is specially designed for the twisted-pair cable. A twisted-pair wire cutter usually
includes additional blades for stripping the wire.
Wire Stripper: - This tool is used to remove the outer and inner jackets of the network cable. Typically, you do not need
to purchase this tool separately as all standard twisted-pair wire cutters are equipped with wire-strippers.

The following image shows two twisted-pair wire cutter tools equipped with wire-strippers.

Crimp tool: - This tool is used to attach the connectors to the cable. Typically, this tool also includes a wire-cutter and
wire-stripper. So if you buy a crimp tool, you don't have to buy a wire-cutter and wire-striper separately.

The following image shows a crimping device equipped with a wire-stripper and wire-cutter.

Which tool you should buy depends on your requirements and budget. For example, if you want to install a dozen network
cables, you can buy less expensive tools such as a low-cost wire stripper and a cheap crimp device. But if you are in a
network cable setting up business or have a medium or large-sized network, you should buy a crimping tool that has a
built-in a wire stripper and wire cutter. A high-quality twisted-pair cable crimping tool will cost you around $100 but will
save you many headaches in the long run.

Network cable testing and troubleshooting tools

A network cable testing and troubleshooting tool is used for the following purposes.

 To measure the length of a segment or network cable.


 To detect loose connectors.
 To identify an un-labeled network cable from all network cables.
 To find a break in the network cable.
 To certify the cable installation.

The following section describes the most common network cable testing and troubleshooting tools.
Cable certifier

This device thoroughly tests a network cable and certifies that the cable installation meets a special wiring standard such
as Cat 5e, Cat 6, Cat 6a, and so forth. This device can check and test total segment length, crosstalk, noise, wiremap,
resistance, impedance, and the capability to transfer data at the maximum frequency rated for the cable.

The following image shows a network cable certifier.

Since this device performs a complete test and certifies the cable installation, it will cost you more than all the other test
devices listed in this section. If you have a mid-size network or if you can buy this device, then you should always buy
and use this device to manage network cables.

Basic cable tester

If you can't afford a network cable certifier, you can buy and use this device to manage your network cables. Besides
certifying the cable installation, this device provides all remaining functionalities of a network cable certifier. It can test
cable length, cross talk, and breaks in the cable. It can also check whether the connectors on both ends of a network cable
are properly attached or not.

The following image shows a basic network cable tester tool.

Tone generator and the probe

This device is used to trace the unlabelled network cables. This device comes in two pieces: the tone generator and the
probe. The tone generator generates tones or signals and places them on the network cable. The probe detects these signals
on the other end of the cable.

You can use this tool to identify network cables that run from a central location to remote locations. For example, if you
are working on a patch-panel or switch and trying to figure out which network cable connects back to an end-device (such
as a PC), then you can use this device.
Place a tone generator at one end of the connection (end-device), and use the probe on another side (switch or patch-panel)
to determine which network cable the tone generator is connected to.

The following image shows an example of a tone generator and probe.

Time domain reflectometer

This device is used to measure the length of a network cable as well as the breaks in the cable. This device transmits a
signal on one end and measures the time the signal takes to reach the end of the cable. You can also use this device to find
breaks in the cable. For example, this device can tell you approximately how far the break is located in the cable.

The following image shows a time domain reflectometer.


AIM: STUDY OF STRAIGHT AND CROSSOVER CABLE

Ethernet straight-through cables

A straight through cable is a type of twisted pair cable that is used in local area networks to connect a computer
to a network hub such as a router. This type of cable is also sometimes called a patch cable and is an alternative
to wireless connections where one or more computers access a router through a wireless signal. On a straight
through cable, the wired pins match. Straight through cable use one wiring standard: both ends use T568A
wiring standard or both ends use T568B wiring standard. The following figure shows a straight through cable of
which both ends are wired as the T568B standard.

In this cable, wires are placed in the same position at both ends. The wire at pin 1 on one end of the cable connects to pin
1 at the other end of the cable. The wire at pin 2 connects to pin 2 on the other end of the cable; and so on.

The following table lists the wire positions of the straight-through cable on both sides.

Side A Side B

Green White Green White

Green Green

Orange White Orange White

Blue Blue

Blue White Blue White

Orange Orange

Brown White Brown White

Brown Brown

The following image shows the straight-through cable.


A straight-through cable is used to connect the following devices.

 PC to Switch
 PC to Hub
 Router to Switch
 Switch to Server
 Hub to Server

Ethernet cross-over cable

An Ethernet crossover cable is a type of Ethernet cable used to connect computing devices together directly. Unlike
straight through cable, crossover cables use two different wiring standards: one end uses the T568A wiring standard, and
the other end uses the T568B wiring standard. The internal wiring of Ethernet crossover cables reverses the transmit and
receive signals. It is most often used to connect two devices of the same type: e.g. two computers (via network interface
controller) or two switches to each other.

In this cable, transmitting pins of one side connect with the receiving pins of the other side.

The wire at pin 1 on one end of the cable connects to pin 3 at the other end of the cable. The wire at pin 2 connects to pin
6 on the other end of the cable. Remaining wires connect in the same positions at both ends.

The following table lists the wire positions of the cross-over cable on both sides.

Side A Side B

Green White Orange White

Green Orange

Orange White Green White


Blue Blue

Blue White Blue White

Orange Green

Brown White Brown White

Brown Brown

The following image shows the cross-over cable.

The cross-over cable is used to connect the following devices.

 Two computers
 Two hubs
 A hub to a switch
 A cable modem to a router
 Two router interfaces
AIM : STUDY OF NETWORK PHYSICAL EQUIPMENT/ DEVICES LIKE: ROUTER,
HUB, REPEATORS, SWITCHES AND MODEMS.

Hub
Hub is a centralized device that connects multiple devices in a single LAN network. When Hub receives the data signals
from a connected device on any of its port, except that port, it forwards those signals to all other connected devices from
the remaining ports. Usually, Hub has one or more uplink ports that are used to connect it with another Hub.

There are two types of the Hub.

Passive Hub: - It forwards data signals in the same format in which it receives them. It does not change the data signal in
any manner.

Active Hub: - It also works same as the passive Hub works. But before forwarding the data signals, it amplifies them. Due
to this added feature, the active Hub is also known as the repeater.

Hubs are no longer used in the computer networks.

Switch
Just like Hub and Bridge, Switch is also used to connect the multiple devices together in a LAN segment. Basically, a Switch
is the upgraded version of the Bridge. Besides providing all the functionalities of Bridge, it also offers several additional
features.
The biggest advantage of Switch is that, it makes switching decisions in hardware by using application specific integrated
circuits (ASICs).

Unlike the generic processors that we use in our PC, ASICs are the specialized processors built only to perform very few
particular tasks. Usually, the ASICs in the Switches have single task and that is the switching the frames as fast as possible.

An ASIC occupied switch performs this task blazingly fast. For example, an entry level Catalyst Switch 2960 can process 2.7
million frames per second.

Modem

Modem is a device which converts the computer-generated digital signals of a computer into analog signals to
enable their travelling via phone lines. The ‘modulator-demodulator’ or modem can be used as a dial up for LAN
or to connect to an ISP. Modems can be both external, as in the device which connects to the USB or the serial
port of a computer, or proprietary devices for handheld gadgets and other devices, as well as internal; in the form
of add-in expansion cards for computers and PCMCIA cards for laptops.
Repeater 

A repeater operates at the physical layer. Its job is to regenerate the signal over the same network before the
signal becomes too weak or corrupted so as to extend the length to which the signal can be transmitted over
the same network. An important point to be noted about repeaters is that they do not amplify the signal. When
the signal becomes weak, they copy the signal bit by bit and regenerate it at the original strength. It is a 2 port
device.

When an electrical signal is transmitted via a channel, it gets attenuated depending upon the nature
of the channel or the technology. This poses a limitation upon the length of the LAN or coverage area
of cellular networks. This problem is alleviated by installing repeaters at certain intervals.
Repeaters amplifies the attenuated signal and then retransmits it. Digital repeaters can even
reconstruct signals distorted by transmission loss. So, repeaters are popularly incorporated to
connect between two LANs thus forming a large single LAN. This is shown in the following diagram −
TYPES OF REPEATERS
According to the types of signals that they regenerate, repeaters can be classified into two categories

 Analog Repeaters − They can only amplify the analog signal.


 Digital Repeaters − They can reconstruct a distorted signal.
According to the types of networks that they connect, repeaters can be categorized into two types −

 Wired Repeaters − They are used in wired LANs.


 Wireless Repeaters − They are used in wireless LANs and cellular networks.
According to the domain of LANs they connect, repeaters can be divided into two categories −

 Local Repeaters − They connect LAN segments separated by small distance.


 Remote Repeaters − They connect LANs that are far from each other.
AIM:

Router
The router connects the different network segments. It switches the data packets between those networks which are either
located in the different logical segments or built with the different network layer protocols.

When a router receives a data packet on any of its interface, it checks the destination address of that packet and based on
that destination address, it forwards that data packet from the interface which is connected with the destination address.

To forward a data packet to its destination, router keeps the records of connected networks. These records are maintained
in a database table known as the routing table. Routing table can be built statically or dynamically.

Basically, routers are used: -

 To connect different network segments.


 To connect different network protocols such as IP and IPX.
 To connect several smaller networks into a large network (known as the Internetwork)
 To break a large network into smaller networks (Known as the Subnets. Usually created to improve the
performance or manageability.)
 To connect two different media types such as UTP and Fiber optical.
 To connect two different network architectures such as Token Ring and Ethernet.
 To connect LAN network with Telco company’ office (Known as the DTE device).
 To access DSL services (known as the DSL Router).

Bridge
Bridge is used to divide a large network into smaller segments. Basic functions of the Bridge are the following: -

 Breaking a large network into smaller segments.


 Connecting different media types. Such as connects UTP with the fiber optic.
 Connecting different network architectures. Such as connects Ethernet with the Token ring.
A Bridge can connect two different types of media or network architecture, but it cannot connect two different types of
network layer protocol such as TCP/IP or IPX. Bridge requires the same network layer protocol in all segments.

There are three types of Bridge: -

Local Bridge: - This Bridge connects two LAN segments directly. In Ethernet Implementation, it is known as the
Transparent Bridge. In Token Ring network, it is called the Source-Routed Bridge.

Remote Bridge: - This Bridge connects with another Bridge over the WAN link.

Wireless Bridge: - This Bridge connects with another Bridge without using wires. It uses radio signals for the connectivity.
In OSI Layers /TCP-IP networking models, the functionalities of the Bridges are defined in the physical layer and data link
layer.

Just like Hubs, Bridge no longer used in the computer network. Bridges have been replaced by the Switches.

Gateway
Gateway is used to forward the packets which are generated from the local host or network and but intended for the
remote network. If a data packet does not find its destination address in the local network then it takes the help of the
gateway device to find the destination address in the remote network. A gateway device knows the path of the remote
destination address. If require, it also changes the encapsulation of the packet so it can travel through the other networks
to get its destination address.

Gateway is a device which is used to connect multiple networks and passes packets from one packet to the other network.
Acting as the ‘gateway’ between different networking systems or computer programs, a gateway is a device which forms a
link between them. It allows the computer programs, either on the same computer or on different computers to share
information across the network through protocols. A router is also a gateway, since it interprets data from one network
protocol to another.

Examples of the Gateway


Email Gateway: - Translates SMTP e-mail in standard X.400 format before forwarding.

GSNW Gateway: - Allows Windows clients to access resources from the NetWare server.

PAD Gateway: - Provides connectivity between LAN network and X.25 network.
MULTIPLEXER

Muxing (or) multiplexing can be defined as; it is a way of transmitting various signals over a media or single line. A common kind of

multiplexing merges a number of low-speed signals to send over an only high-speed link, or it is used to transmit a medium as well as

its link with the number of devices. It provides both privacy & Efficiency. The entire process can be done using a device namely MUX

or multiplexer, and the main function of this device is to unite n-input lines for generating a single output line. Thus, MUX has many

inputs & single outputs. A device is called DEMUX or demultiplexer is used at the receiving end which divides the signal into its

component signals. So, it has single input and number of outputs.

Multiplexing

TYPES OF MULTIPLEXING TECHNIQUES

Multiplexing techniques are mainly used in communication, and these are classified into three types. The 3 types of

multiplexing techniques include the following.


 Frequency Division Multiplexing (FDM)
 Wavelength Division Multiplexing (WDM)
 Time Division Multiplexing (TDM)
AIM: STUDY OF BASIC NETWORKING COMMAND

Tracert / traceroute
Tracert: Determines the path taken to a destination by sending Internet Control Message Protocol (ICMP) Echo Request
messages to the destination with incrementally increasing Time to Live (TTL) field values. The path displayed is the list of
near-side router interfaces of the routers in the path between a source host and a destination. The near-side interface is
the interface of the router that is closest to the sending host in the path. Used without parameters, tracert displays help.
This diagnostic tool determines the path taken to a destination by sending ICMP Echo Request messages with varying
Time to Live (TTL) values to the destination. Each router along the path is required to decrement the TTL in an IP packet by
at least 1 before forwarding it.

Effectively, the TTL is a maximum link counter. When the TTL on a packet reaches 0, the router is expected to return an
ICMP Time Exceeded message to the source computer. Tracert determines the path by sending the first Echo Request
message with a TTL of 1 and incrementing the TTL by 1 on each subsequent transmission until the target responds or the
maximum number of hops is reached. The maximum number of hops is 30 by default and can be specified using the -h
parameter.

The path is determined by examining the ICMP Time Exceeded messages returned by intermediate routers and the Echo
Reply message returned by the destination. However, some routers do not return Time Exceeded messages for packets
with expired TTL values and are invisible to the tracert command. In this case, a row of asterisks (*) is displayed for that
hop.

Examples:

To trace the path to the host named www.google.co.in use following command

tracert www.google.co.in

To trace the path to the host named www.google.com and prevent the resolution of each IP address to its name, type:
tracert -d www.google.com

To trace the path to the host named www.google.com and use the loose source route 10.12.0.1-10.29.3.1-10.1.44.1, type:
tracert -j 10.12.0.1 10.29.3.1 10.1.44.1 www.google.com
Syntax

tracert [-d] [-h MaximumHops] [-j HostList] [-w Timeout] [TargetName]


Parameters

- Prevents tracert from attempting to resolve the IP addresses of intermediate routers to their names. This can speed up
d the display of tracert results.

- MaximumHops Specifies the maximum number of hops in the path to search for the target (destination). The default is
h 30 hops.

-j HostList Specifies that Echo Request messages use the Loose Source Route option in the IP header with the set of
intermediate destinations specified in HostList. With loose source routing, successive intermediate destinations can be
separated by one or multiple routers. The maximum number of addresses or names in the host list is 9. The HostList is
a series of IP addresses (in dotted decimal notation) separated by spaces.

- Timeout Specifies the amount of time in milliseconds to wait for the ICMP Time Exceeded or Echo Reply message
w corresponding to a given Echo Request message to be received. If not received within the time-out, an asterisk (*) is
displayed. The default time-out is 4000 (4 seconds).

Ping
Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) Echo
Request messages. The receipt of corresponding Echo Reply messages are displayed, along with round-trip times. Ping is
the primary TCP/IP command used to troubleshoot connectivity, reachability, and name resolution.
You can use ping to test both the computer name and the IP address of the computer. If pinging the IP address is
successful, but pinging the computer name is not, you might have a name resolution problem. In this case, ensure that the
computer name you are specifying can be resolved through the local Hosts file, by using Domain Name System (DNS)
queries, or through NetBIOS name resolution techniques.
To test a TCP/IP configuration by using the ping command:

 To quickly obtain the TCP/IP configuration of a computer, open Command Prompt, and then type ipconfig . From
the display of the ipconfig command, ensure that the network adapter for the TCP/IP configuration you are testing is not
in a Media disconnected state.
 At the command prompt, ping the loopback address by typing ping 127.0.0.1
 Ping the IP address of the computer.
 Ping the IP address of the default gateway. If the ping command fails, verify that the default gateway IP address is
correct and that the gateway (router) is operational.
 Ping the IP address of a remote host (a host that is on a different subnet). If the ping command fails, verify that the
remote host IP address is correct, that the remote host is operational, and that all of the gateways (routers) between this
computer and the remote host are operational.
 Ping the IP address of the DNS server. If the ping command fails, verify that the DNS server IP address is correct,
that the DNS server is operational, and that all of the gateways (routers) between this computer and the DNS server are
operational.

Arp
Displays and modifies entries in the Address Resolution Protocol (ARP) cache, which contains one or more tables that are
used to store IP addresses and their resolved Ethernet or Token Ring physical addresses. There is a separate table for each
Ethernet or Token Ring network adapter installed on your computer.

Syntax

arp [-a [InetAddr] [-N IfaceAddr]] [-g [InetAddr] [-N IfaceAddr]] [-d InetAddr [IfaceAddr]] [-s
InetAddr EtherAddr [IfaceAddr]]
Parameters
Used without displays help
parameters

-a [InetAddr] [- Displays current ARP cache tables for all interfaces. To display the ARP cache entry for a
N IfaceAddr] specific IP address, use arp -a with the InetAddr parameter, where InetAddr is an IP address. To
display the ARP cache table for a specific interface, use the -N IfaceAddr parameter where
IfaceAddr is the IP address assigned to the interface. The -N parameter is case-sensitive.

-g [InetAddr] [- Identical to -a.


N IfaceAddr]

-d InetAddr Deletes an entry with a specific IP address, where InetAddr is the IP address. To delete an entry
[IfaceAddr] in a table for a specific interface, use the IfaceAddr parameter where IfaceAddr is the IP address
assigned to the interface. To delete all entries, use the asterisk (*) wildcard character in place of
InetAddr.

-s InetAddr Adds a static entry to the ARP cache that resolves the IP address InetAddr to the physical
EtherAddr address EtherAddr. To add a static ARP cache entry to the table for a specific interface, use the
[IfaceAddr] IfaceAddr parameter where IfaceAddr is an IP address assigned to the interface.

Examples:

To display the ARP cache tables for all interfaces use following command

arp -a

To display the ARP cache table for the interface that is assigned the IP address 192.168.42.171
Netstat
Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4
statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over
IPv6 protocols).

Netstat provides statistics for the following:

 Proto - The name of the protocol (TCP or UDP).


 Local Address - The IP address of the local computer and the port number being used. The name of the local
computer that corresponds to the IP address and the name of the port is shown unless the -n parameter is specified. If the
port is not yet established, the port number is shown as an asterisk (*).
 Foreign Address - The IP address and port number of the remote computer to which the socket is connected. The
names that corresponds to the IP address and the port are shown unless the -n parameter is specified. If the port is not yet
established, the port number is shown as an asterisk (*).

(state) Indicates the state of a TCP connection. The possible states are as follows:

 CLOSE_WAIT
 CLOSED
 ESTABLISHED
 FIN_WAIT_1
 FIN_WAIT_2
 LAST_ACK
 LISTEN
 SYN_RECEIVED
 SYN_SEND
 TIMED_WAIT

Syntax

netstat [-a] [-e] [-n] [-o] [-p Protocol] [-r] [-s] [Interval]
Parameters

Used without displays active TCP connections.


parameters

-a Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.

-e Displays Ethernet statistics, such as the number of bytes and packets sent and received. This parameter
can be combined with -s.

-n Displays active TCP connections, however, addresses and port numbers are expressed numerically and no
attempt is made to determine names.

-o Displays active TCP connections and includes the process ID (PID) for each connection. You can find the
application based on the PID on the Processes tab in Windows Task Manager. This parameter can be
combined with -a, -n, and -p.

-p Shows connections for the protocol specified by Protocol. In this case, the Protocol can be tcp, udp,
tcpv6, or udpv6. If this parameter is used with -s to display statistics by protocol, Protocol can be tcp,
udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.

-s Displays statistics by protocol. By default, statistics are shown for the TCP, UDP, ICMP, and IP protocols.
If the IPv6 protocol for Windows XP is installed, statistics are shown for the TCP over IPv6, UDP over
IPv6, ICMPv6, and IPv6 protocols. The -p parameter can be used to specify a set of protocols.
-r Displays the contents of the IP routing table. This is equivalent to the route print command.

Interval Redisplays the selected information every Interval seconds. Press CTRL+C to stop the redisplay. If this
parameter is omitted, netstat prints the selected information only once.

/? - Displays help at the command prompt.

Nbtstat
Displays NetBIOS over TCP/IP (NetBT) protocol statistics

NetBIOS name tables for both the local computer and remote computers, and the NetBIOS name cache. Nbtstat allows a
refresh of the NetBIOS name cache and the names registered with Windows Internet Name Service (WINS).

Nbtstat command-line parameters are case-sensitive.

Syntax

nbtstat [-a RemoteName] [-A IPAddress] [-c] [-n] [-r] [-R] [-RR] [-s] [-S] [Interval]
Parameters

Used without displays help.


parameters

-a RemoteName Displays the NetBIOS name table of a remote computer, where RemoteName is the NetBIOS
computer name of the remote computer. The NetBIOS name table is the list of NetBIOS names that
corresponds to NetBIOS applications running on that computer.

-A IPAddress Displays the NetBIOS name table of a remote computer, specified by the IP address (in dotted
decimal notation) of the remote computer.

-c Displays the contents of the NetBIOS name cache, the table of NetBIOS names and their resolved IP
addresses.

-n Displays the NetBIOS name table of the local computer. The status of Registered indicates that the name is
registered either by broadcast or with a WINS server.

-r Displays NetBIOS name resolution statistics. On a Windows XP computer that is configured to use WINS,
this parameter returns the number of names that have been resolved and registered using broadcast and
WINS.

-R Purges the contents of the NetBIOS name cache and then reloads the #PRE-tagged entries from the
Lmhosts file.

-RR Releases and then refreshes NetBIOS names for the local computer that is registered with WINS servers.

-s Displays NetBIOS client and server sessions, attempting to convert the destination IP address to a name.
-S Displays NetBIOS client and server sessions, listing the remote computers by destination IP address only.

Interval Redisplays selected statistics, pausing the number of seconds specified in Interval between each display.
Press CTRL+C to stop redisplaying statistics. If this parameter is omitted, nbtstat prints the current
configuration information only once.

/? - Displays help at the command prompt.

Ipconfig
Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and
Domain Name System (DNS) settings. This command is most useful on computers that are configured to obtain an IP
address automatically. This enables users to determine which TCP/IP configuration values have been configured by DHCP,
Automatic Private IP Addressing (APIPA), or an alternate configuration.

 If the Adapter name contains any spaces, use quotation marks around the adapter name (that is, "Adapter Name").
 For adapter names, ipconfig supports the use of the asterisk (*) wildcard character to specify either adapters with
names that begin with a specified string or adapters with names that contain a specified string.
 For example, Local* matches all adapters that start with the string Local and *Con* matches all adapters that
contain the string Con.

Syntax

ipconfig [/all] [/renew [Adapter]] [/release [Adapter]] [/flushdns] [/displaydns] [/registerdns]


[/showclassid Adapter] [/setclassid Adapter [ClassID]]
Parameters
Used without displays the IP address, subnet mask, and default gateway for all adapters.
parameters

/all Displays the full TCP/IP configuration for all adapters. Without this parameter, ipconfig displays only the IP
address, subnet mask, and default gateway values for each adapter. Adapters can represent physical
interfaces, such as installed network adapters, or logical interfaces, such as dial-up connections.

/renew Renews DHCP configuration for all adapters (if an adapter is not specified) or for a specific adapter if the
[Adapter] Adapter parameter is included. This parameter is available only on computers with adapters that are
configured to obtain an IP address automatically. To specify an adapter name, type the adapter name that
appears when you use ipconfig without parameters.

/release Sends a DHCPRELEASE message to the DHCP server to release the current DHCP configuration and
[Adapter] discard the IP address configuration for either all adapters (if an adapter is not specified) or for a specific
adapter if the Adapter parameter is included. This parameter disables TCP/IP for adapters configured to
obtain an IP address automatically. To specify an adapter name, type the adapter name that appears when
you use ipconfig without parameters.

/flushdns Flushes and resets the contents of the DNS client resolver cache. During DNS troubleshooting, you can use
this procedure to discard negative cache entries from the cache, as well as any other entries that have been
added dynamically.

/displaydns Displays the contents of the DNS client resolver cache, which includes both entries preloaded from the local
Hosts file and any recently obtained resource records for name queries resolved by the computer. The DNS
Client service uses this information to resolve frequently queried names quickly, before querying its
configured DNS servers.

/registerdns Initiates manual dynamic registration for the DNS names and IP addresses that are configured at a
computer. You can use this parameter to troubleshoot a failed DNS name registration or resolve a dynamic
update problem between a client and the DNS server without rebooting the client computer. The DNS
settings in the advanced properties of the TCP/IP protocol determine which names are registered in DNS.

/showclassid Adapter Displays the DHCP class ID for a specified adapter. To see the DHCP class ID for all adapters, use
the asterisk (*) wildcard character in place of Adapter. This parameter is available only on computers with
adapters that are configured to obtain an IP address automatically.

/setclassid Adapter [ClassID] Configures the DHCP class ID for a specified adapter. To set the DHCP class ID for all
adapters, use the asterisk (*) wildcard character in place of Adapter. This parameter is available only on
computers with adapters that are configured to obtain an IP address automatically. If a DHCP class ID is
not specified, the current class ID is removed.

Examples:

ipconfig To display the basic TCP/IP configuration for all adapters


ipconfig /all To display the full TCP/IP configuration for all adapters

ipconfig /renew "Local Area Connection" To renew a DHCP-assigned IP address configuration for only the Local Area
Connection adapter

ipconfig /flushdns To flush the DNS resolver cache when troubleshooting DNS name resolution
problems

ipconfig /showclassid Local To display the DHCP class ID for all adapters with names that start with
Local

ipconfig /setclassid "Local Area To set the DHCP class ID for the Local Area Connection adapter to TEST
Connection" TEST

winipcfg
This utility allows users or adminstrators to see the current IP address and other useful information about your network
configuration. You can reset one or more IP addresses. The Release or Renew buttons allow you to release or renew one IP
address. If you want to release or renew all IP addresses click Release All or Renew All. When one of these buttons is
clicked, a new IP address is obtained from either the DHCP service or from the computer assigning itself an automatic
private IP address. To use the winipcfg utility:

 Click Start,and then click Run and type winipcfg


 Click More Info.
 To see the addresses of the DNS servers the computer is configured to use, click the ellipsis (...) button to the right
of DNS Servers.
 To see address information for your network adapter(s), select an adapter from the list in Ethernet Adapter
Information.

nslookup
Nslookup (Name Server lookup) is a UNIX shell command to query Internet domain name servers.
Definitions

 Nameserver: These are the servers that the internet uses to find out more about the domain. Usually they are an
ISP's computer.
 Mailserver: Where email is sent to.
 Webserver: The domains website.
 FTPserver: FTP is file transfer protocol, this server is where files may be stored.
 Hostname: The name of the host as given by the domain.
 Real Hostname: This is hostname that you get by reverse resolving the IP address, may be different to the given
hostname.
 IP Address: Unique four numbered identifier that is obtained by resolving the hostname.

getmac Command

Another very simple command that shows the MAC address of your network interfaces

Hostname Command

A very simple command that displays the host name of your machine. This is much
quicker than going to the control panel>system route.
AIM: STUDY OF NETWORK IP ADDRESSING

Objective(s):
 To understand theoretical knowledge of IPv4 addressing and sub-netting.
 To understand IP address setting and testing in Linux machine (Ubuntu)
Apparatus: Linux OS (Ubuntu) on virtual machine

Background:
If definitions are helpful to you, use these vocabulary terms to get you started:
 IPv4 address: a 32-bit number, usually written in dotted decimal form, that uniquely identifies an
interface of some computer
 Host Address: another term for IP address
 Network: a group of hosts, all of which have an identical beginning position of their ip addresses.
 Network Number: a 32-bit number that represent a network and it can't be assigned as ip address of a host
 Network address: another term for the network number.
 Broadcast address: a 32-bit number that is used to address all hosts in the network. It can't be
assigned as an ip address of a host.
 Subnet: a group of hosts, all of which have an identical portion of their ip addresses, a subnet
differs from a network in that a subnet is a further subdivision of a network.
 Subnet number: a 32-bit number that represent a subnet. It can't be assigned as ip address of host.
 Subnet address: another term for the subnet number.
 Subnet broadcast address: a 32-bit number that is used to address all hosts in the subnet. It can't be
assigned into a host’s IP address.
 Sub-netting: the process of subdividing networks into smaller subnets.
 Subnet mask: A 32-bit combination used to describe which portion of an address refers to the
subnet and which part refers to the host.
 Network mask: 32-bit number. The mask is used by computers to calculate the network number of
a given IP address by performing a Boolean AND operation of the address and mask.
 Address mask: another term for a mask
 Interface: A network connection.

Understanding IPv4 Addresses and classes


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. 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
20. The bit just to the left of that holds a value of 21. This continues until the left-most bit, or most
significant bit, which holds a value of 27. So if all binary bits are a one, the decimal equivalent would
be 255 as shown here:
1 111111 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.
01000001
0 64 0 0 0 0 0 1 (0+64+0+0+0+0+0+1=65)
And this sample shows an IP address represented in both binary and decimal.
10. 1. 23. 19 (decimal)
00001010.00000001.00010111.00010011 (binary)
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 Variable Length Subnet Masking (VLSM) & Classless Inter-Domain
Routing (CIDR).

IP address classes
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.
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 10. 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 172.16. Octets 3 and 4 (16 bits) are for local subnets and hosts. Class B
addresses is 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 193.18.9. Octet 4 (8 bits) is for local subnets and hosts - perfect for
networks with less than 254 hosts.

Figure 1: Class of IPv4 Network

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.
When sub-netting, a third part of IP address appears in the middle of the address—namely, the subnet
part of the address. The size of the network part never shrinks.
Network (8) Subnet (24-x) Host (x) Class
A
Network Subnet (16-x) Host (x) Class
(16) B
Network Subnet (8-x) Host (x) Class
(24) C
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.
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.1 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

Note: There are two ways to denote these masks. First, since you are using three bits more than the
"natural" Class C mask, you can denote these addresses as having a 3-bit subnet mask. Or, secondly,
the mask of 255.255.255.224 can also be denoted as /27 as there are 27 bits that are set in the mask.
This second method is used with CIDR. Using this method, one of these networks can be described
with the notation prefix/length. For example, 204.17.5.32/27 denotes the network 204.17.5.32
255.255.255.224. The network sub-netting scheme in this section allows for eight subnets, and the
network might appear as:
Figure 2

Notice that each of the routers in Figure 2 is attached to four subnetworks, one subnetwork is common
to both routers. Also, each router has an IP address for each subnetwork to which it is attached. Each
subnetwork could potentially support up to 30 host addresses.
This brings up an interesting point. The more host bits you use for a subnet mask, the more subnets
you have available. However, the more subnets available, the less host addresses available per subnet.
For example, a Class C network of 204.17.5.0 and a mask of 255.255.255.224 (/27) allows you to have
eight subnets, each with 32 host addresses (30 of which could be assigned to devices). If you use a
mask of 255.255.255.240 (/28), the break down is:
204.17.5.0 - 11001100.00010001.00000101.00000000
255.255.255.240 - 11111111.11111111.11111111.11110000
|sub |
Since you now have four bits to make subnets with, you only have four bits left for host addresses. So
in this case you can have up to 16 subnets, each of which can have up to 16 host addresses (14 of
which can be assigned to devices).
Take a look at how a Class B network might be subnetted. If you have network 172.16.0.0, then you
know that its natural mask is 255.255.0.0 or 172.16.0.0/16. Extending the mask to anything beyond
255.255.0.0 means you are subnetting. You can quickly see that you have the ability to create a lot
more subnets than with the Class C network. If you use a mask of 255.255.248.0 (/21), how many
subnets and hosts per subnet does this allow for?
172.16.0.0 - 10101100.00010000.00000000.00000000
255.255.248.0 - 11111111.11111111.11111000.00000000
-|sub|
You are using five bits from the original host bits for subnets. This allows you to have 32 subnets (2 5).
After using the five bits for subnetting, you are left with 11 bits for host addresses. This allows each
subnet so have 2048 host addresses (2 11), 2046 of which could be assigned to devices.
Note: In the past, there were limitations to the use of a subnet 0 (all subnet bits are set to zero) and all
ones subnet (all subnet bits set to one). Some devices would not allow the use of these subnets. Cisco
Systems devices allow the use of these subnets when the ip subnet zero command is configured.

Examples
 Given the network number and a mask, how many subnets are there and how many hosts per subnet.
 Given an address and mask, what is the subnet number
 Given an address and mask, what is the subnet broadcast address and valid ip address on the subnet
 Subnet bits=32-(network bits+ hosts bits)
8.1.4.5/16 130.4.102.1/24 199.1.1.1/24 130.4.102.1/2 199.1.1.100/27
2
Mask 255.255.0.0 255.255.255.0 255.255.255.0 255.255.252.0 255.255.255.22
4
Network bits 8 16 24 16 24
Hosts bits 16 8 8 10 5
Subnet bits 8 8 0 6 3
16 8 8 10
hosts per subnets 2 -2 2 -2 2 -2 2 -2 25-2
No. of subnets 28-2 28-2 0 26-2 23-2

Subnet number 8.1.0.0 130.4.102.0 199.1.1.0 130.3.100.0 199.1.1.96


st
1 valid IP addr. 8.1.0.1 130.4.102.1 199.1.1.1 130.3.100.1 199.1.1.96
Broadcast addr. 8.1.255.255 130.4.102.255 199.1.1.255 130.3.103.255 199.1.1.127
Last valid addr. 8.1.255.254 130.4.102.254 199.1.1.254 130.3.103.254 199.1.1.126

Sample Exercise 1
Now that you have an understanding of subnetting, put this knowledge to use. In this example, you are
given two address / mask combinations, written with the prefix/length notation, which have been
assigned to two devices. Your task is to determine if these devices are on the same subnet or different
subnets. You can do this by using the address and mask of each device to determine to which subnet
each address belongs.
Device A: 172.16.17.30/20
Device B: 172.16.28.15/20

Determining the Subnet for Device A:


172.16.17.30 - 10101100.00010000.00010001.00011110
255.255.240.0 - 11111111.11111111.11110000.00000000
-| sub|-
subnet = 10101100.00010000.00010000.00000000 = 172.16.16.0
Looking at the address bits that have a corresponding mask bit set to one, and setting all the other
address bits to zero (this is equivalent to performing a logical "AND" between the mask and address),
shows you to which subnet this address belongs. In this case, Device A belongs to subnet 172.16.16.0.

Determining the Subnet for Device B:


172.16.28.15 - 10101100.00010000.00011100.00001111
255.255.240.0 - 11111111.11111111.11110000.00000000
- | sub|
subnet = 10101100.00010000.00010000.00000000 = 172.16.16.0
From these determinations, Device A and Device B have addresses that are part of the same subnet.

Sample Exercise 2
Given the Class C network of 204.15.5.0/24, subnet the network in order to create the network in
Figure 3 with the host requirements shown.
Figure 3

Looking at the network shown in Figure 3, you can see that you are required to create five subnets.
The largest subnet must support 28 host addresses. Is this possible with a Class C network? And if so,
then how?
You can start by looking at the subnet requirement. In order to create the five needed subnets you
would need to use three bits from the Class C host bits. Two bits would only allow you four subnets
(22).
Since you need three subnet bits, that leaves you with five bits for the host portion of the address. How
many hosts does this support? 25 = 32 (30 usable). This meets the requirement.
Therefore you have determined that it is possible to create this network with a Class C network. An
example of how you might assign the subnetworks is:
netA: 204.15.5.0/27 host address range 1 to 30
netB: 204.15.5.32/27 host address range 33 to
62 netC: 204.15.5.64/27 host
address range 65 to 94 netD: 204.15.5.96/27
host address range 97 to
126 netE: 204.15.5.128/27 host address range
129 to 158

IP Address Setting on UBUNTU/Linux


Temporary IP Address Assignment
For temporary network configurations, you can use standard commands such as ip, ifconfig and route,
which are also found on most other GNU/Linux operating systems. These commands allow you to
configure settings which take effect immediately, however they are not persistent and will be lost after
a reboot.
To temporarily configure an IP address, you can use the ifconfig command in the following manner.
Just modify the IP address and subnet mask to match your network requirements.
sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0
To verify the IP address configuration of eth0, you can use the ifconfig command in the following manner.
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:15:c5:4a:16:5a
inet addr:10.0.0.100 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::215:c5ff:fe4a:165a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:466475604 errors:0 dropped:0 overruns:0 frame:0
TX packets:403172654 errors:0 dropped:0 overruns:0
carrier:0 collisions:0 txqueuelen:1000
RX bytes:2574778386 (2.5 GB) TX bytes:1618367329 (1.6 GB)
Interrupt:16
To configure a default gateway, you can use the route command in the following manner. Modify the
default gateway address to match your network requirements.
#sudo route add default gw 10.0.0.1 eth0

To verify your default gateway configuration, you can use the route command in the following manner.
#route -n

Kernel IP routing table


Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255. U 1 0 0 eth0
0
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
If you require DNS for your temporary network configuration, you can add DNS server IP addresses in the file
/etc/resolv.conf. In general, editing /etc/resolv.conf directly is not recommanded, but this is a
temporary and non- persistent configuration. The example below shows how to enter two DNS servers
to /etc/resolv.conf, which should be changed to servers appropriate for your network. A more lengthy
description of the proper persistent way to do DNS client configuration is in a following section.
nameserver 8.8.8.8
nameserver 8.8.4.4
If you no longer need this configuration and wish to purge all IP configuration from an interface, you
can use the ip command with the flush option as shown below.
#ip addr flush eth0
Flushing the IP configuration using the ip command does not clear the contents of /etc/resolv.conf.
You must remove or modify those entries manually, or re-boot which should also cause
/etc/resolv.conf, which is actually now a symlink to /run/resolvconf/resolv.conf, to be re-written.
Dynamic IP Address Assignment (DHCP Client)
To configure your server to use DHCP for dynamic address assignment, add the dhcp method to the
inet address family statement for the appropriate interface in the file /etc/network/interfaces. The
example below assumes you are configuring your first Ethernet interface identified as eth0.
auto eth0
iface eth0 inet dhcp
By adding an interface configuration as shown above, you can manually enable the interface through
the ifup command which initiates the DHCP process via dhclient.
#sudo ifup eth0
To manually disable the interface, you can use the ifdown command, which in turn will initiate the
DHCP release process and shut down the interface.
#sudo ifdown eth0

Static IP Address Assignment


To configure your system to use a static IP address assignment, add the static method to the inet
address family statement for the appropriate interface in the file /etc/network/interfaces. The example
below assumes you are configuring your first Ethernet interface identified as eth0. Change the address,
netmask, and gateway values to meet the requirements of your network.
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
By adding an interface configuration as shown above, you can manually enable the interface through
the ifup command.
#sudo ifup eth0 To manually disable

#sudo ifdown eth0

You might also like