Sie sind auf Seite 1von 65

SWAMI VIVEKANAD COLLEGE OF

ENGINEERING, INDORE

INDUSTRIAL TRAINNIG ON
BASICS OF NETWORKING AND INTRODUCTION OF LINUX

SUBMITTED TO SUBMITTED BY
MR. U.B.S. CHANDRAWAT STUTI SAHA
SWAMI VIVEKANAD COLLEGE OF
ENGINEERING, INDORE

CERTIFICATE

This to certify that the industrial training report titled


INDUSTRIAL TRAINNIG ON
BASICS OF NETWORKING AND INTRODUCTION OF LINUX
In the fide work of
STUTI SAHA

This has been successful completed for report work in partial fulfillment of
the requirement for the award of Bachelor of Engineering in Electronics &
Communication, as per the course curriculum prescribed by Rajiv Gandhi
Technical University, BHOPAL, during the academic session 2010-2011.

INTERNAL EXTERNAL
ACKNOWLEDGEMENT

With extreme gratitude I express my thankfulness to all the


members of CMS, Indore for rendering full support in my training
on “THE BASICS OF NETWORKING AND INTRODUCTION
TO LINUX”.

I am sincerely thankful to our faculties, SWAMI


VIVEKANAND COLLEGE OF ENGINEERING for grooming
and instilling me a spirit that helps me to complete my report.

I also express my sincere thanks to our H.O.D.


U.B.S.Chandrawat who was present with us during all presentation
and encouraging me constantly.

Finally, I thank all the teaching and non –teaching


staff members.

STUTI SAHA
ABSTRACT

In this report we are going to discuss some basic concepts of networking,


various terminologies and are going to discuss how basically a network is
being designed and is maintained. Some basic portion of Linux is also being
included in this report. Various basic commands are also being discussed in
the report.
OBJECTIVE

To study the basic concepts of networking and to learn some brief


introduction about LINUX
CONTENTS

1. Abstract
2. Objective
3. Networking:
 Introduction
 Network Topologies
 OSI Model
 TCP/IP Model
 Cables
 IP (Internet protocols)
 Routing protocols
 Other different types of protocols
 Switches

4. Linux:
 Introduction
 Architecture of Linux
 Various commands of Linux
 How to install Linux
 YUM
 WEB SERVER
 FTP
 Open audit

5. Conclusion
6. References
NETWORKING
INTRODUCTION
In the world of computers, networking is the practice of linking two or more computing
devices together for the purpose of sharing data. Networks are built with a mix of
computer hardware and computer software.
A computer network allows sharing of resources and information among interconnected
devices. In the 1960s, the Advanced Research Projects Agency (ARPA) started funding
the design of the Advanced Research Projects Agency Network (ARPANET) for the
United States Department of Defense. It was the first computer network in the
world. Development of the network began in 1969, based on designs developed during
the 1960s.

Purpose
Computer networks can be used for several purposes:
Facilitating communications. Using a network, people can communicate efficiently and
easily via email, instant messaging, chat rooms, telephone, video telephone calls, and
video conferencing.
Sharing hardware. In a networked environment, each computer on a network may
access and use hardware resources on the network, such as printing a document on a
shared network printer.
Sharing files, data, and information. In a network environment, authorized user may
access data and information stored on other computers on the network. The capability of
providing access to data and information on shared storage devices is an important
feature of many networks.
• Sharing software. Users connected to a network may run application programs on
remote computers.
• Information preservation.
• Security.
• Speed up.

NETWORKING DEVICES
Network devices provide transport for the data that needs to be transferred between
end-user devices. Network devices provide extension of cable connections,
concentration of connections, conversion of data formats, and management of data
transfers. Examples of devices that perform these functions are repeaters, hubs,
bridges, switches, and routers
• REPEATER: A repeater is a network device used to regenerate a signal.
Repeaters regenerate analog or digital signals distorted by transmission loss due to
attenuation. A repeater does not perform intelligent routing
• HUB: Hubs concentrate connections. In other words, they take a group of hosts
and allow the network to see them as a single unit. This is done passively, without any
other effect on the data transmission. Active hubs not only concentrate hosts, but they
also regenerate signals.
• BRIDGES: Bridges convert network transmission data formats as well as
perform basic data transmission management. Bridges provide connections between
LANs. Bridges also perform a check on the data to determine whether it should cross
the bridge or not.
• W0RKGROUP SWITCHES: Workgroup switches add more
intelligence to data transfer management. Not only can they determine whether
data should remain on a LAN or not, but they can transfer the data only to the
connection that needs that data. Another difference between a bridge and switch is
that a switch does not convert data transmission formats.

• ROUTERS: Routers can regenerate signals, concentrate multiple


connections, convert data transmission formats, and manage data transfers. They
can also connect to a WAN, which allows them to connect LANs that are
separated by great distances.
TYPES OF NETWORKING:

Example of a basic type of network

1. PAN: It stands for personal area network. It is have a network of single system.
Here limited sources are present.

2. MAN: It stands for main area network or metropolitican area network. It is used
between two different cities. Its range is approx 150km.

3. LAN: It stands for local area network. It is used for fixed geographical area for
system communication. Its range is approx 2.6 miles or 5 km.
4. SAN: It stands for storage area. Here data is being stored in centralized area. E.g.
Hard disk (It can be called as SAN)

5. WAN: It stands for wide area network. It is used when communication is to be


done between two different states. E.g. When communication is to be done
between M.P. and Gujarat WAN is being used.

6. GAN: It stands global area network or geographical area network. Here no


limitation of distance occurs. Satellite communication mainly occurs here.

NETWORK TOPOLOGIES
Network topology defines the structure of the network. One part of the topology
definition is the physical topology, which is the actual layout of the wire or media. The
other part is the logical topology, which defines how the media is accessed by the hosts
for sending data.

Physical Topologies

BUS: A bus topology uses a single backbone cable that is terminated at both ends. All
the hosts connect directly to this backbone .

RING: A ring topology connects one host to the next and the last host to the first.
This creates a physical ring of cable.
STAR: A star topology connects all cables to a central point of concentration .

EXTENDED STAR: An extended star topology links individual stars together


by connecting the hubs and/or switches. This topology can extend the scope and coverage
of the network

HIERARCHICAL: A hierarchical topology is similar to an extended star.


However, instead of linking the hubs and/or switches together, the system is linked to a
computer that controls the traffic on the topology .

MESH: A mesh topology is implemented to provide as much protection as possible


from interruption of service. Each host has its own connections to all other hosts.
PARTIALLY MESH TOPOLOGY

The type of network topology in which some of the nodes of the network are connected
to more than one other node in the network with a point-to-point link – this makes it
possible to take advantage of some of the redundancy that is provided by a physical fully
connected mesh topology without the expense and complexity required for a connection
between every node in the network.

TREE TOPOLOGY

The type of network topology in which a central 'root' node (the top level of the
hierarchy) is connected to one or more other nodes that are one level lower in the
hierarchy (i.e., the second level) with a point-to-point link between each of the second
level nodes and the top level central 'root' node, while each of the second level nodes that
are connected to the top level central 'root' node will also have one or more other nodes
that are one level lower in the hierarchy (i.e., the third level) connected to it, also with a
point-to-point link, the top level central 'root' node being the only node that has no other
node above it in the hierarchy (The hierarchy of the tree is symmetrical.) Each node in
the network having a specific fixed number, of nodes connected to it at the next lower
level in the hierarchy, the number, being referred to as the 'branching factor' of the
hierarchical tree. This tree has individual peripheral nodes.

HYBRID TOPOLOGY
Hybrid networks use a combination of any two or more topologies in such a way that the
resulting network does not exhibit one of the standard topologies (e.g., bus, star, ring,
etc.). For example, a tree network connected to a tree network is still a tree network, but
two star networks connected together exhibit a hybrid network topology. A hybrid
topology is always produced when two different basic network topologies are connected.
Two common examples for Hybrid network are: star ring network and star bus network
• A Star ring network consists of two or more star topologies connected using a
multistation access unit (MAU) as a centralized hub.
• A Star Bus network consists of two or more star topologies connected using a bus
trunk (the bus trunk serves as the network's backbone).

Logical Topologies: The logical topology of a network is how the hosts


communicate across the medium. The two most common types of logical topologies are
broadcast and token passing .

BROADCAST: Broadcast topology simply means that each host sends its data to
all other hosts on the network medium. There is no order that the stations must follow to
use the network. It is first come, first serve. Ethernet works this way

TOKEN PASSING: Broadcast topology simply means that each host sends its
data to all other hosts on the network medium. There is no order that the stations must
follow to use the network. It is first come, first serve. Ethernet works this way.
INTERNETWORKING
Breaking of larger network into smaller one is called network segmentation using routers, switches and
bridges. Used for LAN traffic, for low B.W., having too many hosts in broadcast. For this purpose in 1977,
ISO created OSI model. The main function of of OSI layer is to provide developers a standard based on
which they can make their products. All layers are independent. They have indepent from each other

OSI LAYER MODEL


The Open Systems Interconnection model (OSI model) is a product of the Open
Systems Interconnection effort at the International Organization for Standardization. It is
a way of sub-dividing a communications system into smaller parts called layers. A layer
is a collection of conceptually similar functions that provide services to the layer above it
and receives services from the layer below it.
Layer 1: Physical Layer
The Physical Layer defines the electrical and physical specifications for devices. In
particular, it defines the relationship between a device and a transmission medium, such
as a copper or optical cable. This includes the layout of pins, voltages, cable
specifications, hubs, repeaters, network adapters, host bus adapters (HBA used in storage
area networks) and more. The major functions and services performed by the Physical
Layer are:

• Establishment and termination of a connection to a communications medium.


• Participation in the process whereby the communication resources are effectively
shared among multiple users. For example, contention resolution and flow
control.
• Modulation or conversion between the representation of digital data in user
equipment and the corresponding signals transmitted over a communications
channel. These are signals operating over the physical cabling (such as copper and
optical fiber) or over a radio link.
Layer 2: Data Link Layer
The Data Link Layer provides the functional and procedural means to transfer data
between network entities and to detect and possibly correct errors that may occur in the
Physical Layer. Originally, this layer was intended for point-to-point and point-to-
multipoint media, characteristic of wide area media in the telephone system. Local area
network architecture, which included broadcast-capable multi-access media, was
developed independently of the ISO work in IEEE Project 802. IEEE work assumed sub
layering and management functions not required for WAN use.

Layer 3: Network Layer


The Network Layer provides the functional and procedural means of transferring variable
length data sequences from a source to a destination via one or more networks, while
maintaining the quality of service requested by the Transport Layer. The Network Layer
performs network routing functions, and might also perform fragmentation and
reassembly, and report delivery errors. Routers operate at this layer—sending data
throughout the extended network and making the Internet possible. This is a logical
addressing scheme – values are chosen by the network engineer. The addressing scheme
is not hierarchical.

Careful analysis of the Network Layer indicated that the Network Layer could have at
least three sublayers:

1. Subnetwork Access - that considers protocols that deal with the interface to
networks, such as X.25;
2. Subnetwork Dependent Convergence - when it is necessary to bring the level of a
transit network up to the level of networks on either side;
3. Subnetwork Independent Convergence - This handles transfer across multiple
networks.

Layer 4: Transport Layer

The Transport Layer provides transparent transfer of data between end users, providing
reliable data transfer services to the upper layers. The Transport Layer controls the
reliability of a given link through flow control, segmentation/desegmentation, and error
control. Some protocols are state and connection oriented. This means that the Transport
Layer can keep track of the segments and retransmit those that fail. The Transport layer
also provides the acknowledgement of the successful data transmission and sends the
next data if no errors occurred.

Layer 5: Session Layer

The Session Layer controls the dialogues (connections) between computers. It


establishes, manages and terminates the connections between the local and remote
application. It provides for full-duplex, half-duplex, or simplex operation, and establishes
checkpointing, adjournment, termination, and restart procedures. The OSI model made
this layer responsible for graceful close of sessions, which is a property of the
Transmission Control Protocol, and also for session checkpointing and recovery, which is
not usually used in the Internet Protocol Suite. The Session Layer is commonly
implemented explicitly in application environments that use remote procedure calls.

Layer 6: Presentation Layer

The Presentation Layer establishes context between Application Layer entities, in which
the higher-layer entities may use different syntax and semantics if the presentation
service provides a mapping between them. If a mapping is available, presentation service
data units are encapsulated into session protocol data units, and passed down the stack.
This layer provides independence from data representation (e.g., encryption) by
translating between application and network formats.

Layer 7: Application Layer

The Application Layer is the OSI layer closest to the end user, which means that both the
OSI application layer and the user interact directly with the software application. This
layer interacts with software applications that implement a communicating component.
Such application programs fall outside the scope of the OSI model. Application layer
functions typically include identifying communication partners, determining resource
availability, and synchronizing communication

TCP/IP MODEL
The U.S. Department of Defense (DOD) created the TCP/IP reference model, because it
wanted to design a network that could survive any conditions, including a nuclear war.
TCP/IP was developed as an open standard. This meant that anyone was free to use
TCP/IP
DOD (Department of defense) developed this model in 1960. It consists of four different
layers. The layers are:
• Application layer
• Host to host layer
• Internet layer
• Network layer/Access layer
The figure illustrates some of the common protocols specified by the TCP/IP
reference model layers.
The Process/ Application layer defines protocol for node-to-node application
communication and also controls user interface specification. A vast array of protocols
combine at this layer of DoD’s model to integrate the activities and duties of upper layer
of OSI.
Example for this layer are: Telnet, FTP, TFTP, NFS, SMTP,SNMP, DNS DHCP, BootP
etc.

HOST-TO-HOST LAYER:
The Host-to-Host layer parallel the function of the OSIs Transport layer. It performs the
following:
Defining protocols for setting up the level of transmission service for application
• It tackles issues like creating reliable end-to-end communication.
• It ensures the error free delivery of data.
• It handles packet sequencing and maintains data integrity.

INTERNET LAYER
Internet layer correspond to the OSI’s Network Layer. It performs the following:
Designating the protocols relating to the logical transmission of packets over the entire
network
• It takes care of the addressing of hosts by giving them an IP address
• It handles routing of packets among multiple networks.
• It also controls the communication flow between the two hosts.

NETWORK ACCESS LAYER


This layer is equivalent of the Data Link and Physical Layer of OSI model. It
performs the following:
• It monitors the data exchange between the host and the network.
• Network Access Layer overseas hardware addressing and defines protocols
for the physical transmission of the Data

TELNET: It is used for Terminal Emulation. It allows a user on a remote machine to


access the resource of another machine.
FTP: It allows you to transfer files from one machine to another. It allows access to
both directories and file and uses TCP for data transfer and hence slow but reliable.
NETWORK FILE SYSTEM: It is jewel of protocols specializing in file sharing. It
allows two different types of file system to interoperate.
TFTP ( File Transfer Protocol): This is striped down version of FTP. It has no
directory browsing abilities. It can only send and receive files. It uses UDP for data
transfer and hence faster but not reliable.
LPD(Line Printer Daemon): The Line Printer Daemon protocol/Line Printer
Remote protocol (or LPD, LPR) is a network protocol for submitting print jobs to a
remote printer. The original implementation of LPD was in the Berkeley printing
system in the BSD UNIX operating system; the project also supports that protocol.
The Common UNIX Printing System (or CUPS), which is more common on
modern Linux distributions, supports LPD as well as the Internet Printing Protocol
(IPP).
DNS (Domain Name Service): The Domain Name System (DNS) is a hierarchical
naming system built on a distributed database for computers, services, or any resource
connected to the Internet or a private network. It associates various information
with domain names assigned to each of the participating entities. Most importantly, it
translates domain names meaningful to humans into the numerical identifiers
associated with networking equipment for the purpose of locating and addressing
these devices worldwide.
Bootstrap Protocol (BootP): In computer networking, the Bootstrap Protocol,
or BOOTP, is a network protocol used by a network client to obtain an IP
address from a configuration server. BOOTP is usually used during
the bootstrap process when a computer is starting up. A BOOTP configuration server
assigns an IP address to each client from a pool of addresses. BOOTP uses the User
Datagram Protocol (UDP) as a transport on IPv4 networks only.
DHCP (Dynamic Host Configuration Protocol): The Dynamic Host
Configuration Protocol (DHCP) is an auto configuration protocol used on IP
networks. Computers that are connected to IP networks must be configured before
they can communicate with other computers on the network. DHCP allows a
computer to be configured automatically, eliminating the need for intervention by a
network administrator.
TCP: The Transmission Control Protocol (TCP) is one of the core protocols of
the Internet Protocol Suite. TCP is one of the two original components of the suite,
complementing the Internet Protocol (IP), and therefore the entire suite is commonly
referred to as TCP/IP. TCP provides the service of exchanging data directly between
two network hosts, whereas IP handles addressing and routing message across one or
more networks.
TCP STRUCTURE

TCP Header

Bit
offs 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
et

0 Source port Destination port

32 Sequence number

64 Acknowledgment number

C E U A P R S F
96 Data offset Reserved W C R C S S Y I Window Size
R E G K H T N N

128 Checksum Urgent pointer

160 Options (if Data Offset > 5)


... ...

 Source port (16 bits) – identifies the sending port

A TCP segment consists of a segment header and a data section. The TCP header
contains 10 mandatory fields, and an optional extension field (Options, pink background
in table).
The data section follows the header. Its contents are the payload data carried for the
application. The length of the data section is not specified in the TCP segment header. It
can be calculated by subtracting the combined length of the TCP header and the
encapsulating IP segment header from the total IP segment length (specified in the IP
segment header).

UDP (User Datagram Protocol): The User Datagram Protocol (UDP) is one of the
core members of the Internet Protocol Suite, the set of network protocols used for
the Internet. UDP uses a simple transmission model without implicit hand-shaking
dialogues for providing reliability, ordering, or data integrity. Thus, UDP provides an
unreliable service and datagrams may arrive out of order, appear duplicated, or go
missing without notice.

PACKET STRUCTURE
UDP is a minimal message-oriented Transport Layer protocol that is documented
in IETF RFC 768.
UDP provides no guarantees to the upper layer protocol for message delivery and the
UDP protocol layer retains no state of UDP messages once sent. For this reason, UDP is
sometimes referred to as Unreliable Datagram Protocol.
UDP provides application multiplexing (via port numbers) and integrity verification
(via checksum) of the header and payload. If transmission reliability is desired, it must be
implemented in the user's application.
bits 0 – 15 16 – 31
0 Source Port Number Destination Port Number
32 Length Checksum

64 Data

INTERNET LAYER PROTOCOLS:


• Internet Protocol(IP)
• Internet Control Message Protocol (ICMP)
• Address Resolution Protocol(ARP)
• Reverse Address Resolution Protocol (RARP)

INTERNET PROTOCOL: The Internet Protocol (IP) is the


principal communications protocol used for relaying datagrams(packets) across
an internetwork using the Internet Protocol Suite. Responsible for routing packets
across network boundaries, it is the primary protocol that establishes the Internet.

IP HEADER
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Differentiated
Version IHL Total length
Services
Identification Flags Fragment offset
TTL Protocol Header checksum
Source IP address
Destination IP address
Options and padding :::

Internet Control Message Protocol (ICMP): The Internet Control Message


Protocol (ICMP) is one of the core protocols of the Internet Protocol Suite. It is
chiefly used by the operating systems of networked computers to send error messages
—indicating, for instance, that a requested service is not available or that a host or
router could not be reached. ICMP can also be used to relay query messages.
ICMP segment structure
Header
The ICMP header starts after the IPv4 header. All ICMP packets will have an 8 byte
header and variable sized data section. The first 4 bytes of the header will be consistent.
The first byte is for the ICMP type. The second byte is for the ICMP code. The third and
fourth bytes are a checksum of the entire ICMP message. The contents of the remaining 4
bytes of the header will vary based on the ICMP type and code.

Bits 0-7 8-15 16-23 24-31

0 Type Code Checksum

32 Rest of Header

 Type - ICMP type as specified below.


 Code - further specification of the ICMP type as specified below.
 Checksum - This field contains error checking data calculated from the ICMP
header+data, with value 0 for this field. The algorithm is the same as the header
checksum for IPv4.

Address Resolution Protocol (ARP):


The Address Resolution Protocol (ARP) is a computer networking protocol for
determining a network host's Link Layer or hardware address when only its Internet
Layer (IP) or Network Layer address is known. This function is critical in local area
networking as well as for routing internetworking traffic across gateways (routers) based
on IP addresses when the next-hop router must be determined. ARP was defined in
1982. It is Internet Standard STD 37.
The Address Resolution Protocol uses a simple message format that contains one
address resolution request or response. The size of the ARP message depends on the
upper layer and lower layer address sizes, which are given by the type of networking
protocol (usually IPv4) in use and the type of hardware or virtual link layer that the upper
layer protocol is running on. The message header specifies these types, as well as the size
of addresses of each. The message header is completed with the operation code for
request (1) and reply (2). The payload of the packet consists of four addresses, the
hardware and protocol address of the sender and receiver hosts.

REVERSE ARP (RARP):


The Reverse Address Resolution Protocol (RARP) is an obsolete computer networking
protocol used by a host computer to request its Internet Protocol (IPv4) address from an
administrative host, when it has available its Link Layer or hardware address, such as
a MAC address.
RARP is described in Internet Engineering Task Force (IETF) publication RFC 903. It
has been rendered obsolete by the Bootstrap Protocol (BOOTP) and the modern Dynamic
Host Configuration Protocol (DHCP), which both support a much greater feature set than
RARP.

RARP requires one or more server hosts to maintain a database of mappings of Link
Layer addresses to their respective protocol addresses. Media Access Control (MAC)
addresses needed to be individually configured on the servers by an administrator. RARP
was limited to serving only IP addresses.

Reverse ARP differs from the Inverse Address Resolution Protocol (InARP) described
in RFC 2390, which is designed to obtain the IP address associated with another host's
MAC address. In ARP is the complement of the Address Resolution Protocol used for the
reverse lookup.

COMPARISION BETWEEN OSI MODEL AND TCP/IP MODEL


CISCO THREE LAYER HIERARCHY MODEL
1. CORE LAYER:
It handles the bulk data (traffic). Multilayer switches works over here. Its failure affects
individual data.

2. DISTRIBUTION LAYER:
This layer takes data from the access layer and gives it to core layer. This layer implements
security to the network. Tools like access list and packet filter are being used here.

3. ACCESS LAYER:
It manages all users and is called Desktop layer. It helps continuous access control and polices
from distribution layer and segmentation .It makes n/w more predictable.

CABLES
The cables which are being used in internetworking are having following specifications:
CABLE SPECIFICATIONS:

CABLES DISTANCE THROUGHPUT ETHERNET CONNECTOR


STANDARD
Coaxial thinnet 185 m 10 Mbps 10 Base 2 T-Connector
Coaxial thicknnet 500 m 100 10 Base 5 AUI
Cat 3 100m 100 10 Base T RJ-45
Cat 5 100 m 100 10 Base X/Fast RJ-45
Ethernet
Fiber optic 10 km 64 Fast Ethernet RJ-45
ETHERNET CABLELING

There are three types of cables being used . They are:


• Straight cable
• Cross cable
• Rolled over cable

The major differences between the three cables are as given follows

STRAIGHT CABLE CROSS CABLE ROLLED OVER CABLE


Different devices are Connection between same These cables are used only
connected. devices are being done by for configuration.
E.g. Connection between cross cables E.g. Used for configuring
switch and an system and E.g. Connection between routers and switches.
any router to PC is done by two routers or connection
straight cable between two switches
Colour Coding: Colour Coding: This is types of manageable
White Orange Orange White Green Green switches.
White Green Blur White Orange Blue
White Blue Green White Blue Orange
White Brown Brown White Brown Brown

IP (INTERNET PROTOCOL)
IPV4:

Class A 0 to 127  Used in private IP address


Class B  128 to 191  Used in private IP address
Class C  192 to 223  Mostly public
Class D  224 to 239  Used in multicasting
Class E  240 to 255  Research and invention

SUBNET MASK

• In computer networks, an abbreviation for sub network.


• In mathematics, a subnet (mathematics) of a net in a topological space.
• Subnet mask is used to identify the host and network.
• When using class A we can take the subnet mask of class B and class C.
• When using class B we can take the subnet mask of class C
• When using class C both class A and class B can be used

Class A 255.0.0.0

Class B 255.255.0.0

Class C 255.255.255.0
Range of private IP:

Class A 10.0.0.0 to 10.255.255.255

Class B  172.16.0.0 to 172.31.255.255

Class C  192.10.8.0.0 to 192.168.255.255

IP ADDRESSING

An IP address is a numeric identifier assigned to each machine in an ip network. It


designates the location of device assigned to a network. This type of address is a software
address not a hardware address. It is made up of 32 bits of information. This are divided
in four sections compromising of 4 bytes each.

IP addressing can be of three types. They are:


1. Subneeting
2. VLSM
3. Superneeting

Subneeting VLSM Superneeting


This is of fixed length. Cannot This is variable in length. This Use for root summarization
be used for different subnet can be defined according to
masks. hosts.
Wastage of IP space is more Used to reduce the wastage of Here the root which is
IP. common is being allotted

An Internet Protocol address (IP address) is a numerical label that is assigned to any
device participating in a computer network that uses the Internet Protocol for
communication between its nodes. In other words, it is an address that is assigned to any
device that is connected to a network that follows the Internet Protocol, i.e. the Internet.
An IP address serves two principal functions host or network interface identification and
location addressing.

The Hierarchical IP Addressing Scheme


8 bits 8 bits 8 bits 8
bits

Network Host Host Host

Network Network Host Host

Network Network Network Host


Class A:
Class B:
Class C:

Class D: Multicast
Class E: Research
• Network Address Range :Class A
The Class A range of network address:
00000000=0
01111111=127
• Network Address Range : Class B
The Class B range of network address:
10000000=128
10111111=191
• Network Address Range : Class C
The Class C range of network address:
11000000=192
11011111=223
• Network Address Ranges: Classes D and E
The address between 224 and 225 are reserved for Class D and E network
.Class D (224-239)is used for multicast address and Class E(240-255) for scientific
purpose.
• Network Address :Special Purpose
Some IP address are reserved for special purposes, no network administrator
can’t ever assign these address to nodes.

SUBNETTING
A subnetwork, or subnet, is a logically visible subdivision of an IP network. The
practice of dividing a network into subnetworks is called subnetting.
All computers that belong to a subnet are addressed with a common, identical, most-
significant bit-group in their IP address. This results in the logical division of an IP
address into two fields, a network or routing prefix and the rest field, which is a host
number or interface identifier. The rest field is computer or network interface specific.
The routing prefix is expressed in CIDR notation. It is written as the first address of a
network followed by the bit-length of the prefix, separated by a slash (/) character.
FOR Eg: 192.168.1.0/24 is the prefix of the Internet Protocol Version
4 network starting at the given address, having 24 bits allocated for the network number,
and the rest (8 bits) reserved for host addressing. The IPv6 address
specification2001:db8::/32 is a large network for 296 hosts, having a 32-bit routing
prefix. In IPv4 the routing prefix is also specified in the form of the subnet mask, which
is expressed in quad-dotted decimal representation like an address. For
example, 255.255.255.0 is the network mask for the 192.168.1.0/24 prefix.
The following diagram modifies the example by moving two bits from the host
part to the subnet mask to form a smaller subnet one fourth the previous size:

Binary form Dot-decimal notation

IP address 11000000.10101000.00000101.10000010 192.168.5.130

Subnet mask 11111111.11111111.11111111.11000000 255.255.255.192

Network
11000000.10101000.00000101.10000000 192.168.5.128
prefix

Host part 00000000.00000000.00000000.00000010 0.0.0.2

Here
E.g.: If the IP address of pc is 192.168.1.0. Determine the subnet mask to be used
here.
Sol: The binary transformation of 192 is 11000000
Total number of networks (subnets) = 2 =2²= 4 networks
Total number of host per network= 2-2=64-2=62 hosts/network
Difference between two network=256-192= 64

Valid range of IP:

VLSM
One of the major problems with supporting only a single subnet mask across a given
network number is that once the mask is selected, it locks the organization into a fixed
number of fixed-sized subnets. For example, a Class B subnet that is masked with
255.255.252.0 yields additional 64 subnets with 1024 hosts per subnet. If you need 1028
subnets with some as large as 1000 hosts and some as small as 64 hosts you are out of
luck. Similar to the IP space separation into A,B, and C classes VLSM permits
organization to use subnets with different number of hosts.
FOR Eg: Addresses need to be planned and assigned carefully because VLSM can add a
higher level of complexity to your network administration. To really understand this
process of subnetting a previously subnetted address, let's look at a practical scenario.
Assume that you have been tasked by your CIO to redesign your existing Class B subnet
of 172.16.1.0 /25. This 172.16.1.0 /25 scheme already gives your organization more than
500 subnets of 126 hosts each. However, you have been mandated to divide this one
subnetwork into three departmental broadcast domains of 30 hosts each. In addition, you
need to use this same address space for several WAN point-to-point serial links.
Currently, your Class B subnet address of 172.16.1.0 with a subnet mask of
255.255.255.128 leaves you 7 bits for host addresses, or 126 hosts (27 – 2 = 126). Table
3.4 shows your present addressing scheme for subnet 172.16.1.0 /25.

Table 3.4 The Addressing Scheme for Subnet 172.16.1.0 /25


Description Decimal Subnetwork Binary
Subnetwork address 172.16.1.0 .00000001.00000000
First available host 172.16.1.1 .00000001.00000001
Second available host 172.16.1.2 .00000001.00000010
Last available host 172.16.1.126 .00000001.01111110
Broadcast address 172.16.1.127 .00000001.01111111

To subnet 172.16.1.0 /25 down to a VLSM to gain four subnets, you need to first write
down the original subnetwork in its binary representation, like so:
10101100.00010000.00000001.00000000

Next, identify the bits that make up the original subnet mask with italics:

10101100.00010000.00000001.00000000

Because you need to borrow some bits from the remaining 7 bits for a VLSM mask,
calculate the number you need:

2n = 4 results in

n=2

So, you need two more bits for your VLSM mask, like so:

1 0 1 0 1 1 0 0.0 0 0 1 0 0 0 0.0 0 0 0 0 0 0 1.0 0 0 0 0 0 0 0

_____________network___________|______subnet_____|VSM|__hosts__|

Now that you have 5 bits remaining for the hosts, you can determine the number of
available host addresses:

n is the remaining subnet bits, therefore:

n = 5 and 2n – 2 = 30 hosts per subnetwork

SUPERNETTING
A supernet is an Internet Protocol (IP) network that is formed from the combination of
two or more networks (or subnets) with a common Classless Inter-Domain
Routing (CIDR) routing prefix. The new routing prefix for the combined network
aggregates the prefixes of the constituent networks. It must not contain other prefixes of
networks that do not lie in the same routing path. The process of forming a supernet is
often called supernetting, route aggregation, or route summarization. Supernetting within
the Internet serves as a preventative strategy to avoid topological fragmentation of the IP
address space by using a hierarchical allocation system that delegates control of segments
of address space to regional network service providers. This method facilitates regional
route aggregation.

ROUTING PROTOCOLS
A routing protocol is a protocol that specifies how routers communicate with each other,
disseminating information that enables them to select routes then any two nodes on a
computer network, the choice of the route being done by routing algorithms. Each router
has a priori knowledge only of networks attached to it directly. A routing protocol shares
this information first among immediate neighbors, and then throughout the network. This
way, routers gain knowledge of the topology of the network. For a discussion of the
concepts behind routing protocols, see: Routing.

The term routing protocol may refer specifically to one operating at layer three of the
OSI model, which similarly disseminates topology information between routers.

Although there are many types of routing protocols, three major classes are in widespread
use on IP networks:

• Interior gateway routing via link-state routing protocols, such as OSPF and IS-IS
• Interior gateway routing via path vector or distance vector protocols, such as RIP,
IGRP and EIGRP
• Exterior gateway routing. BGP v4 is the routing protocol used by the public
Internet.

The specific characteristics of routing protocols include

• the manner in which they either prevent routing loops from forming or break them
up if they do
• the manner in which they select preferred routes, using information about hop
costs
• the time they take to converge
• how well they scale up
• many other factors
• Routing is based on routing tables
• Routing is a way of selecting path based of routing tables as it holds all network
information.
• Protocols are set of rules all data can travel within a network.

Routing is of three types:

• Static routing
• Dynamic routing
• Default routing
STATIC ROUTING
Static routing, the alternative to dynamic routing, is the process in which the system
network administrator would manually configure network routers with all the information
necessary for successful packet forwarding. The administrator constructs the routing table
in every router by putting in the entries for every network that could be a destination.
Static routes to network destinations are unchangeable. Static routing is a data
communication concept describing one way of configuring path selection of routers in
computer networks. It is the type of routing characterized by the absence of
communication between routers regarding the current topology of the network. This is
achieved by manually adding routes to the routing table. The opposite of static routing is
dynamic routing, sometimes also referred to as adaptive routing.

In these systems, routes through a data network are described by fixed paths (statically).
These routes are usually entered into the router by the system administrator. An entire
network can be configured using static routes, but this type of configuration is not fault
tolerant. When there is a change in the network or a failure occurs between two statically
defined nodes, traffic will not be rerouted. This means that anything that wishes to take
an affected path will either have to wait for the failure to be repaired or the static route to
be updated by the administrator before restarting its journey. Most requests will time out
(ultimately failing) before these repairs can be made. There are, however, times when
static routes make sense and can even improve the performance of a network. Some of
these include stub networks and default routes

DEFAULT ROUTING
Default route, also known as the gateway of last resort, is the network route used by a
router when no other known route exists for a given IP packet’s destination address. All
the packets for destinations not known by the router's routing table are sent to the default
route. This route generally leads to another router, which treats the packet the same way:
If the route is known, the packet will get forwarded to the known route. If not, the packet
is forwarded to the default-route of that router which generally leads to another router.
And so on. Each router traversal adds a one-hop distance to the route.

Once the router with a known route to a host destination is reached, the router determines
which route is valid by finding the "most specific match". The network with the longest
subnet mask that matches the destination IP address wins.

The default route in IPv4 (in CIDR notation) is 0.0.0.0/0, often called the quad-zero
route. Since the subnet mask given is /0, it effectively specifies no network, and is the
"shortest" match possible. A route lookup that doesn't match anything will naturally fall
back onto this route. Similarly, in IPv6 the default address is given by ::/0.
Routers in an organization generally point the default route towards the router that has a
connection to a network service provider. This way, packets with destinations outside the
organization's local area network (LAN)—typically to the Internet, WAN, or VPN—will
be forwarded by the router with the connection to that provider.

Once it is routed outside the network, if that router does not know the route of the
destination, it will forward it to its own Default Route, which is usually a router
connected to larger number of networks. Similarly, the packet will progress to internet
backbone if still no route is known about the destination IP. It is then considered that the
network does not exist, and the packet is discarded.

Host devices in an organization generally refer to the default route as a default gateway
which can be, and usually is, a filtration device such as a firewall or Proxy server

CONFIGURING STATIC AND DYNAMIC ROUTING


Internet work is defined as two or more networks connected with a router or routers.
Also recall that routers don't keep track of, or care even the slightest bit about, hosts, but
they are extremely concerned about networks and the best path to access each one.

Logical addressing (IP, for example) is what's used to identify each host on the internet
work. Routers read the network portion of an IP address to figure out where in the Net
world a host is and then use a routing table to determine the best path to the network that
the destination host is located on.

Once that network is located, the packet is sent to the destination network by forwarding
the packet, hop-to-hop, until it reaches the specific router that's directly connected to the
destination host's network. From there, the destination host's unique hardware address is
used to get the packet to the host that's supposed to receive it.

It's all about maps


Routers have maps, or at least a form of them. They must have a map of the entire
internetwork to explain to them where each logical network is located, as well as to guide
their decision in choosing the quickest, most efficient way to get there. This map is called
a routing table, and each routed protocol you use has to have its own map. For instance, if
you're running IP, IPX, and AppleTalk on your network, each of your routers will have
three maps—one for each routing protocol—all describing the same physical networks in
a different way.

It's kind of a language barrier thing; the reason each protocol has separate routing tables
is because each protocol really is like a different language. Say you've built a gated
community, and in it, you have a street you named Cat Street. Everyone on that block
speaks English, and the street sign is in English. Then a Spanish family moves in that
doesn't speak any English, so you add a sign that reads Avenida Gato. Next, a French
family moves in—they don't speak English or Spanish—so you add Le Chat to the sign.
You now have three separate signs describing Cat Street in three different ways.

Take a look at Figure A, which has two 2500 routers connected with a serial link.

Figure A

Each router must have all three networks in the routing table in order to send packets
through the internet work.

By default, each router will have the directly connected networks in its routing table.
Before we take a look at the routing tables, let's view the configuration used on each
router.

Here's the basic configuration for the 2500A router.

Here's the basic configuration for the 2500B router.

The 2500B router had the DCE end of the serial link, so the clock rate command needed
to be added. We should now have two networks in each routing table. Let's view each
table with the show ip route command (or the short form: sh ip route). Here's the 2500A
router.

And here's the 2500B router.

The 2500A router is directly connected to subnets 32 and 64. The 2500A must have a
route entered for the 96 subnet. The 2500B router is directly connected to the 64 and 96
subnets. The 2500B router must have an entry for the 32 subnet.

Configuring static routes


Static routes are routes configured and entered into the routing table by the administrator.
Typically, in larger networks, creating nothing but static routes would be a gruesome task
(if not impossible), so dynamic routing is usually used (examples are RIP and OSPF).
However, in smaller networks, static routing can work well; it saves overhead on the
router CPU and bandwidth on the serial links that dynamic routing protocols greedily
consume as fast as my golden retriever will steal and swallow an unattended turkey
sandwich!

To configure a static route, use the global configuration command ip route. Since the
2500A router must understand how to get to the 96 subnet, let's configure a static route
that describes to the router what to do when it receives a packet with a destination IP
network of 192.168.10.96.

The ip route command is broken down as follows:

• · ip route: The command issued to add a route to a routing table


• · 192.168.10.96: The destination network
• · 255.255.255.224: The subnet mask used on the network
• · 192.168.10.66: Where to send a packet with a destination IP network of
192.168.10.96

Notice that the IP routing table now has an entry for the 192.168.10.96 subnet via
192.168.10.66, which is the next hop gateway from the 2500A router.

This is working great; we're halfway to finishing our routing tables. The reason we're
only half done is that the 2500B router still doesn't know how to send packets to the 32
subnet. If a packet is sent from HostA on the 32 subnet over to HostB on the 96 subnet,
it'll definitely get to HostB, and HostB will respond by sending a new packet back to the
configured default gateway. The problem is that 2500B will discard the packet since it
doesn't know how to get to the 32 subnet. So, let's configure 2500B with a route to
network 192.168.10.32.

The ip route command is broken down as follows:

• · ip route: The command used to add a static route


• · 192.168.10.32: The destination route we want router 2500B to know about
• · 255.255.255.224: The mask used in the network
• · 192.168.10.65: The next hop router used to get to subnet 32

The routing table for the 2500B router now knows how to get to subnet 32 and packets
can be sent from HostA to HostB and back again.

Configuring default routing


Since we have an Internet connection off the 2500B serial 0 interface, we need to add a
default route to the routing table of the 2500B router. This is just like adding a static
route, except wildcards of all zeros (0s) are used instead of a network and mask.

Here is an example of configuring the serial 1 interface on the 2500B router and then
setting up default route. The ISP provided an IP address of 200.43.89.65/30 for the
interface. Since /30 is a block size of 4, the valid hosts are 65 and 66. We can set our next
hop to 66 since we were given 65 for our router’s interface.

The default route command is broken down as follows:

• · ip route: The command used to add a static or default route


• · 0.0.0.0: The wildcard used to say “any” network not already in the routing
table
• · 0.0.0.0: Wildcard mask to say “any” network mask
• · 200.43.89.66: Next hop gateway

If you don't know the next hop gateway for some reason, you can always create the
command like this:
ip route 0.0.0.0 0.0.0.0 s1

This will tell the router to send packets that aren't in the routing table out serial 1. Also,
notice that I used the ip classless command. This tells the route not to drop packets that
are destined for a network that's not in the routing table, but to use the default route
instead. If you don't use the ip classless command, packets like that would be dropped
before being sent to the default route. (ip classless is on by default in IOS 12.x.)

Okay, so the routing table on the 2500B router now looks like this.

The S* is a static default route. Notice also that the gateway of last resort is now set as
well. Since a router cannot set a default gateway and since it actually is the default
gateway for a network, routers use a gateway of last resort instead, this is really a default
route.

A couple of tips

• · Routers need current, up-to-date “maps.” If a routing table doesn't have a


route to each network that it's going to be required to send packets to, then
packets will be dropped.
• · Troubleshooting a routing table problem is tough. But by using the ping
program and Trace route command, you can find exactly where a packet is failing
in an internetwork. Each of these commands will be discussed in future articles.
COMPARISION BETWEEN STATIC ROUTING,
DYNAMIC ROUTING AND DEFAULT ROUTING
STATIC ROUTING DYNAMIC ROUTING DEFAULT ROUTING
Used for small network. Based on routing protocols. No information on internal
Admin responsible done network. Information given
manually. Used for both on external network.
internal and external
network.
No protocols are Protocols are being used for Information is send
responsible finding the best routes. manually to external
network.

PROTOCOLS
Basically protocols are of two classes:

1. Classful protocols
2. Classless protocols

Classfull protocols are that protocol which does not send the subnet information in the
network. Classless protocols are that protocol which sends the information of subnet
in the network through routing.

TYPES OF PROTOCOLS

There are three types of protocols. They are:

Link state routing protocol


Distance vector routing protocol
Hybrid protocol
LINK STATE ROUTING PROTOCOL
Link-state routing protocol is one of the two main classes of routing protocols used in
packet switching networks for computer communications, the other major class being the
distance-vector routing protocol. Examples of link-state routing protocols include OSPF
and IS-IS.

The link-state protocol is performed by every switching node in the network (i.e. nodes
that are prepared to forward packets; in the Internet, these are called routers). The basic
concept of link-state routing is that every node constructs a map of the connectivity to the
network, in the form of a graph, showing which nodes are connected to which other
nodes. Each node then independently calculates the next best logical path from it to every
possible destination in the network. The collection of best paths will then form the node's
routing table.

Distributing maps

This description covers only the simplest configuration; i.e. one with no areas, so that all
nodes do have a map of the entire network. The hierarchical case is somewhat more
complex; see the various protocol specifications.

As previously mentioned, the first main stage in the link-state algorithm is to give a map
of the network to every node. This is done with several simple subsidiary steps.

Determining the neighbors of each node

First, each node needs to determine what other ports it is connected to, over fully-
working links; it does this using a simple reachability protocol which it runs separately
with each of its directly-connected neighbors.

Distributing the information for the map

Next, each node periodically and in case of connectivity changes makes up a short
message, the link-state advertisement, which:
• Identifies the node which is producing it.
• Identifies all the other nodes to which it is directly connected.
• Includes a sequence number, which increases every time the source node makes
up a new version of the message.

This message is then flooded throughout the network. As a necessary precursor, each
node in the network remembers, for every other node in the network, the sequence
number of the last link-state message which it received from that node. With that in hand,
the method used is simple.

Starting with the node which originally produced the message, it sends a copy to all of its
neighbors. When a link-state advertisement is received at a node, the node looks up the
sequence number it has stored for the source of that link-state message. If this message is
newer (i.e. has a higher sequence number), it is saved, and a copy is sent in turn to each
of that node's neighbors.

This procedure rapidly gets a copy of the latest version of each node's link-state
advertisement to every node in the network.

Networks running link state algorithms can also be segmented into hierarchies which
limit the scope of route changes. These features mean that link state algorithms scale
better to larger networks.

Creating the map

Finally, with the complete set of link-state advertisements (one from each node in the
network) in hand, it is obviously easy to produce the graph for the map of the network.

The algorithm simply iterates over the collection of link-state advertisements; for each
one, it makes links on the map of the network, from the node which sent that message, to
all the nodes which that message indicates are neighbors of the sending node.

No link is considered to have been correctly reported unless the two ends agree; i.e. if one
node reports that it is connected to another, but the other node does not report that it is
connected to the first, there is a problem, and the link is not included on the map.

Notes about this stage

The link-state message giving information about the neighbors is recomputed, and then
flooded throughout the network, whenever there is a change in the connectivity between
the node and its neighbors, e.g. when a link fails. Any such change will be detected by
the reachability protocol which each node runs with its neighbors.
Calculating the routing table

As initially mentioned, the second main stage in the link-state algorithm is to produce
routing tables, by inspecting the maps. This is again done with several steps.

Calculating the shortest paths

Each node independently runs an algorithm over the map to determine the shortest path
from itself to every other node in the network; generally some variant of Dijkstra's
algorithm is used. This is based around a link cost across each path which includes
available bandwidth among other things.

Basically, a node maintains two data structures: a tree containing nodes which are "done",
and a list of candidates. The algorithm starts with both structures empty; it then adds to
the first one the node itself. The algorithm then repetitively:

• Adds to the second (candidate) list all nodes which are connected to the node just
added to the tree (excepting of course any nodes which are already in either the
tree or the candidate list).

• Of the nodes in the candidate list, moves to the tree (attaching it to the appropriate
neighbor node already there) the one which is the closest to any of the nodes
already in the tree.

• Repeat as long as there aren't any nodes left in the candidate list. (When there are
none, all the nodes in the network will have been added to the tree.)

This procedure ends with the tree containing all the nodes in the network, with the node
on which the algorithm is running as the root of the tree. The shortest path from that node
to any other node is indicated by the list of nodes one traverses to get from the root of the
tree, to the desired node in the tree.

Filling the routing table

With the shortest paths in hand, filling in the routing table is trivial.

For any given destination node, the best path for that destination is the node which is the
first step from the root node, down the branch in the shortest-path tree which leads
toward the desired destination node.

To create the routing table, it is only necessary to walk the tree, remembering the identity
of the node at the head of each branch, and filling in the routing table entry for each node
one comes across with that identity.
Optimizations to the algorithm
The algorithm described above was made as simple as possible, to aid in ease of
understanding. In practice, there are a number of optimizations which are used.

Most importantly, whenever a change in the connectivity map happens, it is necessary to


recompute the shortest-path tree, and then recreate the routing table. Work by BBN
Technologies discovered how to recomputed only that part of the tree which could have
been affected by a given change in the map.

Also, the routing table would normally be filled in as the shortest-path tree is computed,
instead of making it a separate operation.

Failure modes

If all the nodes are not working from exactly the same map, routing loops can form.
(These are situations in which, in the simplest form, two neighboring nodes each think
the other is the best path to a given destination. Any packet headed to that destination
arriving at either node will loop between the two, hence the name. Routing loops
involving more than two nodes are also possible.)The reason is fairly simple: since each
node computes its shortest-path tree and its routing table without interacting in any way
with any other nodes, then if two nodes start with different maps, it is easy to have
scenarios in which routing loops are created.

HYBRID PROTOCOL
In hybrid protocol characteristics of both link state routing and default routing is present.
EIRP protocol is being used in hybrid protocol
DISTANCE VECTOR ROUTING PROTOCOL

In computer communication theory relating to packet-switched networks, a distance-


vector routing protocol is one of the two major classes of routing protocols, the other
major class being the link-state protocol. A distance-vector routing protocol uses the
Bellman-Ford algorithm to calculate paths.

A distance-vector routing protocol requires that a router informs its neighbors of topology
changes periodically and, in some cases, when a change is detected in the topology of a
network. Compared to link-state protocols, which require a router to inform all the nodes
in a network of topology changes, distance-vector routing protocols have less
computational complexity and message overhead. Distance Vector means that Routers
are advertised as vector of distance and direction. 'Direction' is represented by next hop
address and exit interface, whereas 'Distance' uses metrics such as hop count.

Routers using distance vector protocol do not have knowledge of the entire path to a
destination. Instead DV uses two methods:

1. Direction in which or interface to which a packet should be forwarded.


2. Distance from its destination.

Examples of distance-vector routing protocols include Routing Information Protocol


Version 1 & 2, RIPv1 and RIPv2 and IGRP. EGP and BGP are not pure distance-vector
routing protocols because a distance-vector protocol calculates routes based only on link
costs whereas in BGP, for example, the local route preference value takes priority over
the link cost.

Method

The methods used to calculate the best path for a network are different between different
routing protocols but the fundamental features of distance-vector algorithms are the same
across all DV based protocols.

Distance Vector means that Routers are advertised as vector of distance and Direction.
Direction is simply next hop address and exit interface and Distance means such as hop
count.

Routers using distance vector protocol do not have knowledge of the entire path to a
destination. Instead DV uses two methods:
1. Direction in which or interface to which a packet should be forwarded.
2. Distance from its destination.

As the name suggests the DV protocol is based on calculating the direction and distance
to any link in a network. The cost of reaching a destination is calculated using various
route metrics. RIP uses the hop count of the destination whereas IGRP takes into account
other information such as node delay and available bandwidth.

Updates are performed periodically in a distance-vector protocol where all or part of a


router's routing table is sent to all its neighbors that are configured to use the same
distance-vector routing protocol. RIP supports cross-platform distance vector routing
whereas IGRP is a Cisco Systems proprietary distance vector routing protocol. Once a
router has this information it is able to amend its own routing table to reflect the changes
and then inform its neighbors of the changes. This process has been described as ‘routing
by rumor’ because routers are relying on the information they receive from other routers
and cannot determine if the information is actually valid and true. There are a number of
features which can be used to help with instability and inaccurate routing information.

Limitations

Count-to-infinity problem

The Bellman-Ford algorithm does not prevent routing loops from happening and suffers
from the count-to-infinity problem. The core of the count-to-infinity problem is that if
A tells B that it has a path somewhere, there is no way for B to know if the path has B as
a part of it. To see the problem clearly, imagine a subnet connected like as A-B-C-D-E-F,
and let the metric between the routers be "number of jumps". Now suppose that A goes
down (out of order). In the vector-update-process B notices that the route to A, which
was distance 1, is down - B does not receive the vector update from A. The problem is, B
also gets an update from C, and C is still not aware of the fact that A is down - so it tells
B that A is only two jumps from C (C to B to A) , which is false. This slowly propagates
through the network until it reaches infinity (in which case the algorithm corrects itself,
due to the "Relax property" of Bellman Ford).

Partial solutions

RIP uses Split Horizon with Poison Reverse technique to reduce the chance of forming
loops and uses a maximum number of hops to counter the 'count-to-infinity' problem.
These measures avoid the formation of routing loops in some, but not all, cases. The
addition of a hold time (refusing route updates for a few minutes after a route retraction)
avoids loop formation in virtually all cases, but causes a significant increase in
convergence times.

A number of loop-free distance vector protocols, such as EIGRP and DSDV, have been
developed. These avoid loop formation in all cases, but suffer from increased complexity,
and their deployment has been slowed down by the success of link-state routing protocols
such as OSPF.

Example

In this network we have 4 routers A, B, C, and D:

We shall mark the current time (or iteration) in the algorithm with T, and shall begin (at
time 0, or T=0) by creating distance matrices for each router to its immediate neighbors.
As we build the routing tables below, the shortest path is highlighted with the color
green, a new shortest path is highlighted with the color yellow.

from via via via via from via via via via from via via via via from via via via via
A A B C D B A B C D C A B C D D A B C D
to A to A 3 to A 23 to A
T=0
to B 3 to B to B 2 to B
to C 23 to C 2 to C to C 5
to D to D to D 5 to D
At this point, all the routers (A,B,C,D) have new "shortest-paths" for their DV (the list of
distances that are from them to another router via a neighbor). They each broadcast this
new DV to all their neighbors: A to B and C, B to C and A, C to A, B, and D, and D to C.
As each of these neighbors receives this information, they now recalculate the shortest
path using it.

For example: A receives a DV from C that tells A there is a path via C to D, with a
distance (or cost) of 5. Since the current "shortest-path" to C is 23, then A knows it has a
path to D that costs 23+5=28. As there are no other shorter paths that A knows about, it
puts this as its current estimate for the shortest-path from itself (A) to D, via C.
from via via via via from via via via via from via via via via from via via via via
A A B C D B A B C D C A B C D D A B C D
to A to A 3 25 to A 23 5 to A 28
T=1
to B 3 25 to B to B 26 2 to B 7
to C 5 23 to C 26 2 to C to C 5
to D 28 to D 7 to D 5 to D
Again, all the routers have gained in the last iteration (at T=1) new "shortest-paths", so
they all broadcast their DVs to their neighbors; This prompts each neighbor to re-
calculate their shortest distances again.

For instance: A receives a DV from B that tells A there is a path via B to D, with a
distance (or cost) of 7. Since the current "shortest-path" to B is 3, then A knows it has a
path to D that costs 7+3=10. This path to D of length 10 (via B) is shorter than the
existing "shortest-path" to D of length 28 (via C), so it becomes the new "shortest-path"
to D.
from via via via via from via via via via from via via via via from via via via via
A A B C D B A B C D C A B C D D A B C D
to A to A 3 7 to A 23 5 33 to A 10
T=2
to B 3 25 to B to B 26 2 12 to B 7
to C 5 23 to C 8 2 to C to C 5
to D 10 28 to D 31 7 to D 33 9 5 to D
This time, only routers A and D have new shortest-paths for their DVs. So they broadcast
their new DVs to their neighbors: A broadcasts to B and C, and D broadcasts to C. This
causes each of the neighbors receiving the new DVs to re-calculate their shortest paths.
However, since the information from the DVs doesn't yield any shorter paths than they
already have in their routing tables, then there are no changes to the routing tables.
from via via via via from via via via via from via via via via from via via via via
A A B C D B A B C D C A B C D D A B C D
to A to A 3 7 to A 23 5 15 to A 10
T=3
to B 3 25 to B to B 26 2 12 to B 7
to C 5 23 to C 8 2 to C to C 5
to D 10 28 to D 31 7 to D 33 9 5 to D
None of the routers have any new shortest-paths to broadcast. Therefore, none of the
routers receive any new information that might change their routing tables. So the
algorithm comes to a stop.

SWITCHES

1. Can be of two types:


1. Manageable switches
2. Nonmanagable switches
2. Switches can be of multicast or unicast but cannot be of broadcast
3. It is a hardware device.
4. It works fastly in comparison with hubs.
5. Less B.W. is required in switches. It breaks collision domain i.e. breaks the area
where collision occurs.
6. It has 100 ports.
7. There are three types:
• Layer 3
• Layer 2
• LAN
LINUX

LINUX
In1984 The GNU Project and the Free Software Foundation Creates open source version of
UNIX utilities Creates the General Public License (GPL) Software license enforcing open
source principles.
Linux is a number system. It is a multitasking and multilevel operating system. Here
simultaneously many users can work on it. It is open source operating system i.e. its source
code is open to all without any cost. Source code is made on ‘C’ language. It is friendly to
users. Linux is protocol based. Linux is a Unix-like based computer operating system. It has
been ported to a vast variety of computer architectures. TCP can be applied on Linux. So, it
is more secure than any other operating system. It contains collection of multiple programs of
‘C’. It is graphical supportable
In 1991: Linus Torvald Creates open source, UNIX-like kernel, released under the GPLPorts
some GNU utilities, solicits assistance online and Today Linux kernel + GNU utilities =
complete, open source, UNIX-like operating system Packaged for targeted audiences
as distributions
There are some Linux principle :
• Everything is a file (including hardware)
• Small, single-purpose programs
• Ability to chain programs together to perform complex tasks
• Avoid captive user interfaces
• Configuration data stored in text

SOME BASICS OF LINUX: Two types of login screens: virtual consoles (text-based) and
graphical logins (called display managers)
Login using login name and password each user has a home directory for personal file
storage A typical Linux system will run six virtual consoles and one graphical console Server
systems often have only virtual consoles Desktops and workstations typically have both
Switch among virtual consoles by typing: Ctrl-Alt-F[1-6]Access the graphical console by
typing Ctrl-Alt-F7.

Linux architecture
File system

Its file system like all UNIX systems is based on one root directory, or hierarchical top
point with subdirectories underneath it. Some sub-directories act as mount points, where
different physical or networked file systems may be incorporated.

The hardware is also incorporated into the file hierarchy. Device drivers interface to user
applications via an entry in the /dev directory. Process information as well is mapped to
the file system through the /proc directory.

It is interesting to note that UNIX security systems were designed into the architecture.
Raw hardware devices are protected from direct access, and the file system has an inbuilt
security system giving individual access to files on three levels, user only, group
membership, and world access. Each category has read, executable and writes flags that
may be set in any combination.

Kernel -or- System Software

The Linux kernel includes true multitasking, virtual memory, shared libraries, demand
loading, shared copy-on-write executables, proper memory management, and TCP/IP
networking.

Today Linux is a module-loading monolithic kernel. Device drivers and kernel extensions
typically run in ring 0, with full access to the hardware, although some run in user space.
Unlike standard monolithic kernels, device drivers are easily configured as modules, and
loaded or unloaded while running the system. Also unlike standard monolithic kernels,
device drivers can be pre-empted under certain conditions. This latter feature was added
to handle hardware interrupts correctly, and to improve support for symmetry
multiprocessing. Preemption also improves latency, increasing responsiveness and
making
Types of users:

There are two types of users in Linux. They are


 Administrator users
 Normal users

Administrator users are given full authority. Normal users are not given that much full
authority.

Various Basic commands of Linux:

1. How to set password in Linux:


# Passwd (enter)
New UNIX password: ***** (enter)
Password username to give password (enter)
#system-config-(tab) (enter)
#system-config-root password (enter)
#hostname (enter)

2. How to create users:


#useadd username (enter)
Password username (enter)

3. #history  to show the history of the commands which are being used
#history 10 to show last 10 commands being used

4. #clear  used to clear the screen

5. userdel username to del any user

6. Copy command:
#cp source file name destination file name

7. Move command:
#mv source file name destination file name

8. # rm file name to remove any file

9. # rm Directory name to remove any directory

10. Help Command:


 man command name
 what is command name
 info command name
 command-name command—help

11. scp source file name destination file name  for transferring of file

12. ssh destination address  to bring in remote

13. Find Command:


 find dir-name -name file-name
 find /etc -name passwd

14. init 6 used to reboot the window

15. #ls all Linux file system are being shown here

16. #free to show memory size

LINUX FILE SYSTEM


 root is represented by forward /
 home all users come over here
 etc system configuration file used for configuring servers
 proc system generated process
 dev used for connection of different devices
 mnt used for moving the content of pen drive to any place

How TO Install Linux:


After that we have to follow certain instruction.
SOME IMPORTANT DIRECTORIES
• Home Directories: /root,/home/username
• User Executables: /bin, /usr/bin, /usr/local/bin
• System Executables: /sbin, /usr/sbin, /usr/local/sbin
• Other Mountpoints: /media, /mnt
• Configuration: /etc
• Temporary Files: /tmp
• Kernels and Bootloader: /boot
• Server Data: /var, /srv
• System Information: /proc, /sys
• Shared Libraries: /lib, /usr/lib, /usr/local/lib

Users, Groups and Permissions


• Every user is assigned a unique User ID number (UID)
o UID 0 identifies root
• Users' names and UIDs are stored in /etc/passwd
• Users are assigned a home directory and a program that is run when they log in
(usually a shell)
• Users cannot read, write or execute each others' files without permission. Users are
assigned to groups
Each group is assigned a unique Group ID number (gid). GIDs are stored
in /etc/groupEach user is given their own private group. Can be added to other groups
for additional access.All users in a group can share files that belong to the group.

Four symbols are used when displaying permissions:


o r: permission to read a file or list a directory's contents
o w: permission to write to a file or create and remove files from a directory
o x: permission to execute a program or change into a directory and do a long
listing of the directory
o -: no permission (in place of the r, w, or x)
Eg: File permissions may be viewed using ls -l
$ ls -l /bin/login
-rwxr-xr-x 1 root root 19080 Apr 1 18:26 /bin/login
Changing File Ownership:
Only root can change a file's owner. Only root or the owner can change a file's group
Ownership is changed with chown:
• chown [-R] user_name file|directory
Group-Ownership is changed with chgrp:
• chgrp [-R] group_name file|directory

Using the bash Shell


Type Tab to complete command lines
Examples:
$ xte<Tab>
$ xterm
$ ls myf<Tab>
$ ls myfile.txt
Use history command to see list of "remembered" commands. Use the up and down keys to
scroll through previous commands.
Type Ctrl-r to search for a command in command history.
(reverse-i-search)`':
To recall last argument from previous command:
Esc,. (the escape key followed by a period)
Alt-. (hold down the alt key while pressing the period)

Command Editing Tricks:


Ctrl-a moves to beginning of line
Ctrl-e moves to end of line
Ctrl-u deletes to beginning of line
Ctrl-k deletes to end of line
Ctrl-arrow moves left or right by word

Scripting Basics
• Shell scripts are text files that contain a series of commands or statements to be
executed.
o Shell scripts are useful for Automating commonly used commands.
Performing system administration and troubleshooting. Creating simple
applications. Manipulation of text or files.
o
Step 1: Use such as vi to create a text file containing commands
First line contains the magic shebang sequence: #!
#!/bin/bash
Comment your scripts!
Comments start with a #
Step 2: Make the script executable:
$ chmod u+x myscript.sh
To execute the new script:
Place the script file in a directory in the executable path -OR-
Specify the absolute or relative path to the script on the command line
VIM: An advanced text editor

Keystroke behavior is dependent upon vim's "mode"


Three main modes:
Command Mode (default): Move cursor, cut/paste text, change mode
Insert Mode: Modify text
Ex Mode: Save, quit, etc
Esc exits current mode
EscEsc always returns to command mode

Basic System Configuration Tools


Network interfaces are named sequentially: eth0, eth1, etc
Multiple addresses can be assigned to a device with aliases
Aliases are labeled eth0:1, eth0:2, etc.
Aliases are treated like separate interfaces
View interface configuration with ifconfig [ethX]
Enable interface with ifup ethX
Disable interface with ifdown ethX

Device configuration is stored in text files


/etc/sysconfig/network-scripts/ifcfg-ethX
Complete list of options in /usr/share/doc/initscripts-*/sysconfig.txt

Dynamic Configuration Static Configuration

DEVICE=ethX DEVICE=ethX
HWADDR=0:02:8A:A6:30:45 HWADDR=0:02:8A:A6:30:45
BOOTPROTO=dhcp IPADDR=192.168.0.254
ONBOOT=yes NETMASK=255.255.255.0
Type=Ethernet GATEWAY=192.168.2.254
ONBOOT=yes
Type=Ethernet

Global Settings in /etc/sysconfig/network


o Many may be provided by DHCP. GATEWAY can be overridden in ifcfg file
NETWORKING=yes
HOSTNAME=server1.example.com
GATEWAY=192.168.2.254

Finding and Processing Files


• locate foo
o Search for files with "foo" in the name or path
• locate -r '\.foo$'
o Regex search for files ending in ".foo"
• Useful options
o -i performs a case-insensitive search
o -n X lists only the first X matches

Find Example:
• find -name snow.png
o Search for files named snow.png
• find -iname snow.png
o Case-insensitive search for files named snow.png, Snow.png,
SNOW.PNG, etc
• find -user joe -group joe
o Search for files owned by the user joe and the group joe

scp: Secure File Transfer


Secure replacement for rcp
• Layered on top of ssh
o scp source destination
o Remote files can be specified using:
 [user@]host:/path/to/file
o Use -r to enable recursion
o Use -p to preserve times and permissions
o Use -C to compress datastream

User management tools


o Graphical tools: system-config-users
o Command-line:
o useradd
o usermod
o userdel [-r]

Inodes and Directories

ESSENTIAL TOOLS:

The Yum Package Management Tool


FTP SERVER
 Step 1: yum install vsftpd*
 Step 2: service vsftpd restart
 Step 3: mkdir -p /var/ftp/pub/name of directory  to create a directory
 Step 4: cd /var/ftp/pub/name of directory/ (enter)
 Step 5: CLIENT:
#ftp ip address of server
#Name aunonymous (enter)
# ls
#cd pub
# ls
# cd name of directory
# ls
# get name of file

CLIENT:
 web browser
address:- ftp:/address of server/pub/directory name/name of file

TELNET
 Step 1: yum install telnet*
 Step 2: vim /etc/xinetd.d/telnet (enter) to configure the file of telnet
 Step 3: chkconfig telnet on (enter)
 Step 4: telnet ip address of destination

Login: Name of the others user


Password: Of the user of other
WEB SERVER

#yum install httpd*


#hostname stationX.example.com
#vim /etc/sysconfig/network
#vim /etc/httpd/conf/httpd.conf

To copy the lines:


Y6 which lines to paste
P  where want to paste

<VirtualHost stationX.example.com:80>

ServerAdmin root@stationX.example.com
Document root /var/www/html
Server Name stationX.example.com
Errorlog logs/dummyhost.example.com-error-log-customlog
:wq

#cd /var/www/html/
#vim index.html
#service httpd restart
#vim /etc/hosts
Address of server stationX.example.com
CONCLUSION

Some areas to explore:


RHEL includes several languages
o Compiled Languages
 C, C++, Java, Ada, Assembly, FORTRAN 77
o Interpreted Languages
 Bash, Perl, Python, PHP, Ruby, Lisp/Scheme
o Programmers' Editors
 vi/vim, emacs/xemacs, the Eclipse IDE
o Lots more!

The primary difference between Linux and many other popular contemporary operating
systems is that the Linux kernel and other components are free and open source software.
Linux is not the only such operating system, although it is by far the most widely
used. Some free and open source software licenses are based on the principle of copyleft,
a kind of reciprocity: any work derived from a copyleft piece of software must also be
copyleft itself.
Linux based distributions are intended by developers for interoperability with other
operating systems and established computing standards. Linux systems adhere
to POSIX, SUS, ISO, and ANSI standards where possible, although to date only one
Linux distribution has been POSIX.1 certified, Linux-FT.

Das könnte Ihnen auch gefallen