Beruflich Dokumente
Kultur Dokumente
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 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
STUTI SAHA
ABSTRACT
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.
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)
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 .
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).
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
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.
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.
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.
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.
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
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
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
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 :::
32 Rest of Header
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.
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:
The major differences between the three cables are as given follows
IP (INTERNET PROTOCOL)
IPV4:
SUBNET MASK
Class A 255.0.0.0
Class B 255.255.0.0
Class C 255.255.255.0
Range of private IP:
IP ADDRESSING
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.
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:
Network
11000000.10101000.00000101.10000000 192.168.5.128
prefix
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
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.
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:
_____________network___________|______subnet_____|VSM|__hosts__|
Now that you have 5 bits remaining for the hosts, you can determine the number of
available host addresses:
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 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.
• 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
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 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.
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.
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.
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.
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 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.
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.
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
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
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.
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.
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.
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.
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.
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.
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.
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
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:
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.
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
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
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.
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:
Administrator users are given full authority. Normal users are not given that much full
authority.
3. #history to show the history of the commands which are being used
#history 10 to show last 10 commands being used
6. Copy command:
#cp source file name destination file name
7. Move command:
#mv source file name destination file name
11. scp source file name destination file name for transferring of file
15. #ls all Linux file system are being shown here
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
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
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
ESSENTIAL TOOLS:
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
<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
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.