0% found this document useful (0 votes)
30 views158 pages

Chapter 12 - Network Essentials

Uploaded by

Arpan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views158 pages

Chapter 12 - Network Essentials

Uploaded by

Arpan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 158

Multimedia

Principles

Chapter 12

Network Essentials

TMH Chapter - 12 1
Network Essentials
Introduction
ƒ A network is an interconnection of two or more computers for the
purpose of sharing information and resources

ƒ Apart from computers a network may also include other devices like
printers, tape drives, hubs, switches, routers etc. Each of these devices
is generally referred to as a Node.

ƒ When a device is turned on and able to access the network it is called


On-line, otherwise it is called Off-line.

ƒ The various devices are connected together using communication lines


like telephone lines, coaxial cables, optical fibers etc. and use some
communication software to communicate

TMH Chapter - 12 2
Network Essentials
Terminology
ƒ Local Area Network (LAN) : A communication network consisting
of computers distributed over a relatively small geographical area
like a building or a group of buildings within a campus

ƒ Wide Area Network (WAN) : Similar to a LAN but spanning a


much greater area like a country or even the entire globe.

ƒ Node : A general term for any device on the network.

ƒ Bandwidth : The amount of data which can be transmitted over a


particular segment of a network within a specified amount of time
e.g. Mbps
TMH Chapter - 12 3
Network Essentials
Terminology
ƒ Load : Denotes the total number of users using the resources of the
network at a time. Determines the overall network activity and
performance speeds

ƒ Network Administrator : A person responsible for managing the activities


on a network and maintain its efficiency under various conditions.

TMH Chapter - 12 4
Network Essentials
Network Types
ƒ Peer-to-peer : All the computers on the networks act as peers i.e. they
have equal rights and priviledges, and share information equally.
Applications run on each system indipendently and no single system
controls the network

ƒ Client-Server : Here the network consists of two classes of computers.


The Servers, which are the more powerful machines control the
activities of the network by providing services to other systems.

ƒ They usually contain a central repository of data and resources, and


often a NOS to manage these.

TMH Chapter - 12 5
Network Essentials
Network Types
ƒ The other class of machines called Clients are less powerful machines
which take resources from the servers.

ƒ Programs running on the clients are called front-end applications and


often retrieve data from the back-end servers using SQL.

ƒ Each client has a specific level of access that enables them to use, view
or manipulate data on the servers

TMH Chapter - 12 6
Network Essentials
Network Types
ƒ The advantages of a Client-Server network include the following:
• A central location of data enables easier management and maintenance
• Security measures like password protection and periodic backup of data
are easier to implement.
• Since the clients share the resources of the server, only one copy of the
resources are necessary instead of individual copies on all the clients
thereby avoiding duplication.
• Data being located at a single location, can be updated periodically
thereby providing consistency, instead of different versions of the data
on various clients.
• The total computing load is distributed among the clients and servers
thus allowing the machines to run more efficiently
TMH Chapter - 12 7
Network Essentials
Topology
ƒ A network topology denotes the physical pattern to which a network
conforms. The topology determines how data flows, the level of fault
tolerance, the management and trouble-shooting considerations.
Multiple topologies may be combined within a single network

ƒ Star : Connects all network devices through a central point, usually a


server. The network provides fault tolerance if one or more clients fail,
but stops functioning if the central server fails

ƒ Bus : Simplest of the configurations. Each of the devices attached to a


single trunk cable. A break in the cabling anywhere allows separate
segments to function

TMH Chapter - 12 8
Network Essentials
Topology
ƒ Ring : Devices are connected to each other in a circle. If a single device
fails the rest of the network continues to function properly

TMH Chapter - 12 9
Network Essentials
Components
ƒ Network Interface Card is an expansion card that is added to a
computer to enable it to communicate on a network

ƒ The NIC physically connects a computer on a network to the network


cable

ƒ It is also responsible for converting the data from the computer into a
form which can be sent out over the network and vice versa

ƒ A network card can have various types of connectors to accommodate


various types of cables

ƒ The NIC usually has a memory buffer where information is temporarily


stored and transmitted to or from the network
TMH Chapter - 12 10
Network Essentials
Components
ƒ The manufacturer of a NIC encodes an unique physical address into the
hardware

ƒ The physical address is also called hardware address or media access


control (MAC) address

ƒ It is a 48-bit address of the form 00-40-95-e0-5d-c7

ƒ The first 24 bits (00-40-95) is the vendor’s unique code while the
remaining bits (e0-5d-c7) is the unique device ID

TMH Chapter - 12 11
Network Essentials
Components
ƒ The Network medium is the general term used to describe all of the
cabling and connectors used to connect a network. The most common
types are :
(1) Coaxial Cables
(2) Twisted Pair Cables
(3) Fiber Optic Cables

ƒ Other than cables many wireless media are also used like Infra-
red and LASER devices, radio and cellular connections,
microwave antenna and digital satellites

TMH Chapter - 12 12
Network Essentials
Components
ƒ The coaxial cables implement the Ethernet specifications. Ethernet was
originally developed by Xerox Corp.in the 1970s as a broadcast
medium.

ƒ The Thick Ethernet or 10Base5 cables are connected as shown. The


cable is 0.4 inch in diameter and relatively inflexible with coaxial
structure

ƒ The outer insulation (jacket) of the cable may be of PVC (yellow) or


Teflon (orange-brown). The conductor is of solid copper.

TMH Chapter - 12 13
Network Essentials
Components
ƒ Surrounding the layer of conductor is a layer of insulation and a braided
shield.

ƒ The cable segments are connected using BNC (N-type barrel


connectors). Installing the connectors onto the cable requires special
crimping tools

ƒ A transceiver must be used to attach the cable to the NIC. The


transceiver apart from receiving and transmitting data from the NIC also
performs collision detect.

TMH Chapter - 12 14
Network Essentials
Components

TMH Chapter - 12 15
Network Essentials
Components
ƒ A transceiver drop cables connects the NIC to the transceiver. The drop
cable is referred to as AUI Cable (Attachment Unit Interface) and cable
be maximum of 50 meters length

ƒ The maximum segment length is 500 m., maximum network length is


2500 m., maximum number of nodes per segment is 100 and minimum
separation between nodes should be 2.5 m.

TMH Chapter - 12 16
Network Essentials
Components
ƒ The other variant of coaxial cable is called Thin Ethernet or 10Base2. It
has similar internal structure but 0.2 inch in diameter and is much more
flexible.

ƒ This is directly connected to a matching connector on the NIC using a T-


connector. No transceiver or drop cable is required

ƒ The maximum segment length is 185 m., maximum network length is


925 m., maximum number of nodes per segment is 30 and minimum
separation between nodes should be 0.5 m.

TMH Chapter - 12 17
Network Essentials
Components

TMH Chapter - 12 18
Network Essentials
Components
ƒ The Ethernet 10BaseT specifications provides for twisted pair cables.
These come in two types : UTP (unshielded) and STP (shielded).

ƒ Maximum cable length is 100 m. One pair carries Transmit signals, the
other pair carries Receive signals

ƒ The two wires in each pair must be twisted together for the entire length
of the segment, a standard technique to improve the signal carrying
characteristics of a wire pair

ƒ Multiple twisted pair segments communicate by way of a multiport hub

ƒ CAT1 & 2 are used for voice and low speed transmissions, CAT3 for
10Mbps, CAT4 for 16Mbps and CAT5 for 100Mbps
TMH Chapter - 12 19
Network Essentials
Components

TMH Chapter - 12 20
Network Essentials
Components
ƒ In fiber optic cables the use of light pulses provides electrical isolation
for equipment at both ends

ƒ The computer is equipped with a NIC having a 15 pin AUI connector.


This connector allows a connection to a Fiber Optic Media Attachment
Unit (FOMAU) using a standard AUI cable

ƒ The FOMAU is connected to the Repeater hub with two strands of fiber
optic cable

ƒ A major advantage of the 10Base-FL fiber optic link is the long distance
it can span (2000 m). Another advantage is the high transmission
speeds (100 Mbps).

TMH Chapter - 12 21
Network Essentials
Components

TMH Chapter - 12 22
Network Essentials
Components
ƒ Network protocols are sets of rules based on which network devices
communicate with each other and share each other’s resources.

ƒ Global standardization bodies develop the set of rules and individual


companies try to write software conforming to those rules

ƒ NetBEUI - Developed by IBM in 1980s and used by Microsoft as the


default protocol for Windows platform. Very easy to install and
configure. The only required parameter is a computer name and a
workgroup or domain name. Major disadvantage is that it is not routable.

TMH Chapter - 12 23
Network Essentials
Components
ƒ SPX/IPX - Developed by Novell for its Netware operating system. It is
not a single protocol but a collection of procedures to connect
computers on a network running on Novell Netware. The IPX part is
responsible for transmitting packets between Netware nodes. SPX
accounts for splitting and combining the data at the source and
destination respectively. Major disadvantage is that it works only on the
Netware platform.

ƒ TCP/IP – A collection of rules for providing communication across


network computers with diverse architecture and operating systems.
The TCP part splits the data into packets and again recombines them at
the destination. The IP part deals with actually sending the packet from
source to destination. TCP also verifies whether data at the destination
is intact or corrupted, and if necessary asks the source machine to
retransmit data

TMH Chapter - 12 24
Network Essentials
TCP/IP
ƒ For identifying each node on a network TCP/IP uses an addressing
scheme by which it allots a unique IP Address to each node.

ƒ IP addresses are 32-bit numbers separated into four groups called


Octets. It is of the form : aaaaaaaa . bbbbbbbb . cccccccc . dddddddd

ƒ Each IP address has two parts : a Host ID and a Network ID. The
Network ID identifies the particular network to which a host machine
belongs while the Host ID identifies the actual host within the network

ƒ Based on the number of bits allocated to the network ID and host ID we


can have three classes of IP addresses : Class A, Class B, Class C

TMH Chapter - 12 25
Network Essentials
TCP/IP
ƒ Class A networks have the first octet (aaaaaaaa) allocated to network
IDs while the other three octets (bbbbbbbb.cccccccc.dddddddd) are
allocated to host IDs

ƒ Class B networks have the first two octets (aaaaaaaa.bbbbbbbb)


allocated to network IDs and the remaining two octets
(cccccccc.dddddddd) to host IDs

ƒ Class C networks have the first three octets


(aaaaaaaa.bbbbbbbb.cccccccc) allocated to network IDs and the
remaining octet (dddddddd) to host ID

TMH Chapter - 12 26
Network Essentials
TCP/IP

Class-A Networks
Ranges from 00000000 (0) to 01111111 (127)
Network ID cannot be all 0s (reserved for local network) or 127 (reserved for internal
Network ID loopback function)
Thus permissible values are : 00000001 (1) to 01111110 (126)
Total number of network IDs permissible : 126
Ranges from 00000000 . 00000000 . 00000000 (0.0.0) to 11111111 . 11111111 . 11111111
(255.255.255)
Host ID cannot be all 0s (reserved for local network) or all 1s (reserved for broadcast
address)
Host ID
Thus permissible values are : 00000000 . 00000000 . 00000001 (0.0.1) to 11111111 .
11111111 . 11111110 (255.255.254)
Total number of host IDs permissible : [(0 to 255) X (0 to 255) X (0 to 255)] -2 (excluding
all 0s and all 1s) : 16777214
Thus Class-A IP addresses
00000001 . 00000000 . 00000000 . 00000001 (1.0.0.1)
range from
to 01111110 . 11111111 . 11111111 . 11111110 (126.255.255.254)
TMH Chapter - 12 27
Network Essentials
TCP/IP

Class-B Networks
Ranges from 10000000 . 00000000 (128.0) to 10111111 . 11111111 (191.255)
Network ID The above are all permissible values.
Total number of network IDs permissible : [(128 to 191) X (0 to 255)] : (64 X 256) : 16384
Ranges from 00000000 . 00000000 (0.0) to 11111111 . 11111111 (255.255)
Host ID cannot be all 0s (reserved for local network) or all 1s (reserved for broadcast
address)
Host ID
Thus permissible values are : 00000000 . 00000001 (0.1) to 11111111 . 11111110 (255.254)
Total number of host IDs permissible : [(0 to 255) X (0 to 255)] -2 (excluding all 0s and all
1s) : (256 X 256) -2 : 65534
Thus Class-B IP addresses
10000000 . 00000000 . 00000000 . 00000001 (128.0.0.1)
range from
to 10111111 . 11111111 . 11111111 . 11111110 (191.255.255.254)

TMH Chapter - 12 28
Network Essentials
TCP/IP

Class-C Networks
Ranges from 11000000 . 00000000 . 00000000 (192.0.0) to 11011111 . 11111111 .
11111111 (223.255.255)
Network ID The above are all permissible values.
Total number of network IDs permissible : [(192 to 233) X (0 to 255) X (0 to 255)] : (32 X
256 X 256) : 2097152
Ranges from 00000000 (0) to 11111111 (255)
Host ID cannot be all 0s (reserved for local network) or all 1s (reserved for broadcast
Host ID address)
Thus permissible values are : 00000001 (1) to 11111110 (254)
Total number of host IDs permissible : [(0 to 255)] -2 (excluding all 0s and all 1s) : 254
Thus Class-C IP addresses
11000000 . 00000000 . 00000000 . 00000001 (192.0.0.1)
range from
to 11011111 . 11111111 . 11111111 . 11111110 (223.255.255.254)

TMH Chapter - 12 29
Network Essentials
TCP/IP
ƒ For two machines to communicate with TCP/IP, both must have TCP/IP
running on them and both must be assigned a unique IP address.
…………………………………………

ƒ The TCP portion takes the data stream and breaks it up into small
packets of data. Each individual packet is called a “datagram”
… … … … … … … … … … … … …

ƒ TCP puts a header in each datagram. The header contains, among


other things, the sequence number of the packets, and a port number

T… T… T… T… T… T… T… T… T… T… T…

TMH Chapter - 12 30
Network Essentials
TCP/IP
ƒ Each packet is made up of several octets. TCP computes the checksum
by adding all octets of the packets and stores this also in the header.
T…C T…C T…C T…C T…C T…C T…C T…C T…C T…C T…C

ƒ TCP then hands over the datagram to the IP portion. IP is concerned


with the actual transmission of the packets from one machine to
another.

ƒ IP takes each datagram and puts its own header which, among other
things, contains the source and destination IP addresses of the
machines.
IT…C IT…C IT…C IT…C IT…C IT…C IT…C IT…C IT…C IT…C

TMH Chapter - 12 31
Network Essentials
TCP/IP
ƒ IP then releases the packets on the physical medium of the
network.

ƒ The network ID part of the IP address is used to determine the


destination network. If the destination resides on the same network , the
host ID part of the IP address is used to locate the actual destination
host.

ƒ If the network ID of the destination specifies a different network, TCP/IP


of the source sends the packets to the default router.

TMH Chapter - 12 32
Network Essentials
TCP/IP
ƒ The router determines which network the packets should be sent to. It
may be the destination network itself or another router nearer to the
destination network

ƒ The router determines which network the packets should be sent to. It
may be the destination network itself or another router nearer to the
destination network

ƒ The packets may have to be routed by several routers before they reach
the destination network. Each of these routings is called a hop.

TMH Chapter - 12 33
Network Essentials
TCP/IP

TMH Chapter - 12 34
Network Essentials
TCP/IP
ƒ Once the destination network is reached, the host ID part of the
destination IP address is used to locate the actual destination host

ƒ The IP of the destination host accepts the packets and verifies the
destination IP address matches its own. If they do, it removes the IP
headers from the packets and hand them over to TCP

ƒ TCP verifies the checksum in the TCP header. If the checksums match,
TCP accepts the packet as valid. If they do not match, TCP assumes
that the packets have been damaged in transit and discards the
packets. It then asks the sending TCP to re-send the packet again.

TMH Chapter - 12 35
Network Essentials
TCP/IP
ƒ After all the packets have been validated and accepted, TCP uses the
sequence number to recombine the packets into the original information
and then uses the “port number” to send it to the proper application level
protocol like FTP, telnet, HTTP etc.

ƒ For better management networks are organized into a logical set of


layers. Each layer has a definite set of functionalities and provides
certain services to the upper layer while taking some service from the
lower layer

ƒ Each layer of one host communicates with the corresponding layer of


another host using a set of rules called protocol. Each layer of a
particular host communicates with the upper or lower layers using an
interface

TMH Chapter - 12 36
Network Essentials
TCP/IP

TMH Chapter - 12 37
Network Essentials
TCP/IP
ƒ The International Standards Organization (ISO) has broken up the
function of moving data from one point to another into seven different
tasks. The implementation of the TCP/IP software gives rise to a four-
layered model.
ISO Model TCP/IP Model
7. Application Layer 4. Application Layer
6. Presentation Layer 3. Transport Layer
5. Session Layer 2. Internet Layer
4. Transport Layer 1. Physical Layer
3. Network Layer
2. Datalink Layer
1. Physical Layer
TMH Chapter - 12 38
Network Essentials
TCP/IP
ƒ The ISO model is more generalized built for accommodating any
set of protocols based on software engineering practices.
However it led to some discrepancy between design
considerations and actual implementation specifications. It was
also considered too complex.

ƒ TCP/IP model was based on a working set of protocols, which people


were already using when ISO model was released. However it could not
be used for working with non-TCP/IP networks. Also it was not
considered scalable

TMH Chapter - 12 39
Network Essentials
TCP/IP
The Physical Layer
• Concerned with physical specifications of the signals like voltage levels
& pulse durations, and of network connectors like pin specifications.

The Datalink Layer


• Concerned with issues like dealing with transmission errors and flow
control between devices of varying speeds.

TMH Chapter - 12 40
Network Essentials
TCP/IP
The Network Layer
• This layer determines which path the data should take for traveling from
source to destination based on network conditions, priority and other
factors. Implemented on hosts as well as routers. Usually works in
unreliable connection-less mode.

• Unreliable implies no attempt is made to verify whether the entire data


has arrived at the destination without any error. Connection less is
modeled after the postal system – no attempt is made to establish a
connection with the destination machine before the messages are sent.

• The most commonly used protocol at this layer is the Internet Protocol
(IP) although a variety of other protocols, like ICMP and ARP, also
assist IP.
TMH Chapter - 12 41
Network Essentials
TCP/IP
The Transport Layer
• This layer splits data from higher layers into smaller units before
handing them to network layer. Usually works in reliable connection-
oriented mode.

• Reliable implies that TCP attempts to verify that all the messages have
reached the destination without any error. Connection oriented is
modeled after the telephone system and attempts to establish a
connection with the destination before sending messages e.g. FTP

• The main transport layer protocols are TCP, which provides reliable
delivery through error checking, and UDP, which does not guarantee
delivery will be accomplished.
TMH Chapter - 12 42
Network Essentials
TCP/IP
The Session Layer
• This layer enables two applications on different computers to establish,
use and end a connection called a “session”. Sessions manage dialog
control and synchronization between user tasks.

The Presentation Layer


• This layer converts the data format sent down from the application layer
into a commonly recognized intermediary format like ASCII or EBCIDIC
character sets.
• This layer also manages network security issues by providing services
like data encryption. This layer also provides rules for data compression.

TMH Chapter - 12 43
Network Essentials
TCP/IP
The Application Layer
• Provides an interface for communication between the user-level
application programs and the network services. Includes
protocols like FTP, Telnet, SNMP etc.

TMH Chapter - 12 44
Network Essentials
TCP/IP
Internet Protocol (IP)
• Internet Protocol is the mailroom of the TCP/IP stack, where packet
sorting and delivery take place.

• The message unit for IP is the “datagram”. A datagram is a short


message that is transmitted discretely. Datagrams are passed to IP from
TCP or UDP above.

• IP is responsible for delivering datagrams to hosts. When a destination


host resides on a different physical network from the sending host, IP
makes use of routers to transport the datagrams.

TMH Chapter - 12 45
Network Essentials
TCP/IP
Internet Protocol (IP)
• IP is an unreliable, best-effort, connectionless delivery service.
Unreliable because delivery is not guaranteed. A packet might be lost,
delivered out of sequence, duplicated or delayed. Reliability is the
responsibility of higher level protocols like TCP.

• Each IP datagram has a header which is a sequence of bits that serves


to label the datagram and control how the datagram is managed.
Includes fields below

Version (4 bits) : Specifies version of IP. Current version is 4.


Header Length (4 bits) : Specifies number of 32-bit words in the header.

TMH Chapter - 12 46
Network Essentials
TCP/IP
Internet Protocol (IP)
Total Length (16 bits) : Specifies the total length of datagram (header +
data).
Time to Live (8 bits) : Specifies the number of hops the datagram can
experience before it is discarded.
Protocol (8 bits) : Identifies the upper-layer protocol that generated the
data payload. Enables the receiving IP to deliver data to appropriate
protocol.
Source Address (32 bits) : IP address of the host that originated
datagram.
Destination Address (32 bits) : IP address of destination of the
datagram.
TMH Chapter - 12 47
Network Essentials
TCP/IP
Internet Protocol (IP)
IP Address vs. MAC Address :

1. Not all hosts have a network adapter. IP addresses enable hosts


such as dial-up clients to connect to an IP network without a physical
network.

2. Physical addresses are long and cryptic and not very user-friendly.
Using TCP/IP an organization can assign IP addresses by creating a
numbering system that meets the needs of the network.

TMH Chapter - 12 48
Network Essentials
TCP/IP
Internet Protocol (IP)
IP Address vs. MAC Address :

3. Physical addresses are only used when both devices reside on the
same physical network. IP addresses provide a method of addressing
devices that reside on remote networks.

4. If a network adapter fails or is upgraded, it can be replaced without


requiring a new IP address. Also if a host is moved from one network to
another, it can be given a new IP address without requiring a new
network adapter.

TMH Chapter - 12 49
Network Essentials
TCP/IP
Internet Protocol (IP)
• When a host has been configured with an IP address that does not have
the same network ID as the other hosts on that network, it will not be
able to communicate with any host on the network.

• Any message it transmits will automatically be sent to a default router by


its own TCP/IP because of the difference in source and destination
network IDs.

• No host will be able to send messages to the non-conforming host


because other hosts will assume it is attached to a remote network,
forcing them to send the message to the router instead.
TMH Chapter - 12 50
Network Essentials
TCP/IP
Internet Protocol (IP)
• A subnet mask is a 32-bit number used to inform TCP/IP hosts which
bits of the IP address correspond to the network address and which bits
correspond to the host address.

• TCP/IP protocols use the subnet mask to determine if a destination host


address is located on the local network or on a remote network.

• Masking means simply designating where the division between the


network ID and the host ID occurs.

TMH Chapter - 12 51
Network Essentials
TCP/IP
Internet Protocol (IP)

• All bits in a subnet mask that correspond to the network address are set
to 1 and all bits corresponding to the host address are set to 0.

• A bitwise AND operation is performed between the IP address and


subnet mask to separate out the network ID and host ID.

TMH Chapter - 12 52
Network Essentials
TCP/IP
Internet Protocol (IP)

IP Address : 172.25.16.51
Subnet Mask : 255.255.0.0

IP Address 10101100 00011001 00010000 00110011


Subnet Mask 11111111 11111111 00000000 00000000
Network ID 10101100 00011001
Host ID 00010000 00110011

TMH Chapter - 12 53
Network Essentials
TCP/IP
Internet Protocol (IP)

The ipconfig and winipcfg utilities :


• To find out the IP address and subnet mask of your own computer use
the ipconfig utility. This displays all the current TCP/IP configuration
values including IP address, subnet mask and default gateway (router)
address.

• On a Windows computer the equivalent of ipconfig utility is winipcfg. The


output of winipcfg is shown in a dialog box instead of the command
prompt.

TMH Chapter - 12 54
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)

• In order for computers to communicate on a network they must


ultimately know each other’s physical address (or hardware address).

• ARP is used to obtain the physical address of a destination host from


the host’s IP address.

• ARP functions are divided into two parts : determining hardware


address of a destination host, and answering requests from other hosts
that are requesting a hardware address.

TMH Chapter - 12 55
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)

• When a host is about to send a datagram the following sequence of


events take place :

1. IP calls ARP with a request for the hardware address of the


destination host.

2. ARP creates a “request frame” for requesting the hardware address


associated with an IP address. The frame includes the source and
destination IP addresses.

TMH Chapter - 12 56
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)

3. The ARP “request frame” is then sent as a broadcast on the network.

4. All hosts on the network receive the ARP request frame and attempt
to match the IP address in the frame with their own.

5. If a host finds that its IP address matches IP address in the ARP


request frame, it generates an ARP “reply frame” that contains its
hardware address, otherwise it discards the frame.

6. The ARP reply frame is sent directly to the sending host.

TMH Chapter - 12 57
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)

• An ARP packet includes the following fields. The source host completes
all fields except the Target’s Hardware Address, which is filled by the
target host.

Hardware Address Length (8 bits) : Specifies length in bytes of the


hardware address. Ethernet and token ring addresses have a length of
6 bytes.

Protocol Address Length (8 bits) : Specifies length in bytes of the


protocol address. IP addresses are 4 bytes in length.
TMH Chapter - 12 58
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)
Sender’s Hardware Address (48 bits) : Specifies hardware address of
the host generating the ARP request.

Sender’s IP Address (32 bits) : Specifies IP address of the host


generating the ARP request.

Target’s Hardware Address (48 bits) : This will contain the hardware
address of the target host. This is completed by the target when it
responds to the request.

Target’s IP Address (32 bits) : Specifies the IP address of the target


host.
TMH Chapter - 12 59
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)
• The destination host must reside on the same physical network
as the source host.

• ARP cannot be used to determine the hardware address of a


host on a remote network, because broadcasts are not
propagated across IP routers.

• If the target host does reside on a remote network, IP sends the


datagram to a router for forwarding. In this case the source host uses
ARP to determine the hardware address of a router that can forward the
datagram towards the destination host.
TMH Chapter - 12 60
Network Essentials
TCP/IP

TMH Chapter - 12 61
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)
ARP Cache
• Broadcasts are costly because in addition to the traffic generated every
host on the network must perform some processing to determine
whether they should respond or ignore the message.

• To minimize the number of broadcasts necessary each host maintains a


local table called the “ARP Cache”. This contains the most recently used
IP Address-to-Hardware Address mappings.

• ARP always examines its cache before initiating a request. Since it is in


temporary memory it must be re-created on restarting the computer.
TMH Chapter - 12 62
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)
ARP Cache
• Entries in the ARP cache have a limited lifetime. Different
implementation of TCP/IP use different time-out values. It can be as
short as 30 seconds to as long as several hours.

• The shorter the time, the more ARP broadcasts need to occur. Longer
cache times can cause problems if hardware addresses of target hosts
change (by installing a new network adapter).

• If the ARP cache reaches its maximum capacity before an entry expires
the oldest entries are deleted as new ones are added.
TMH Chapter - 12 63
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)
ARP Cache
• When a host computer makes frequent ARP requests to a
specific host, it is possible to create a static entry in the ARP
cache without ageing.

• This eliminates repetitive broadcasts to the same host but can


create problems if either IP address or hardware address of the
target changes

TMH Chapter - 12 64
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)
The arp utility

You can view and manage ARP cache using the arp utility. The syntax
for the arp command is as follows :
arp [-a][-d][-s] inet_addr [phys_addr]
-a : Displays current ARP entries in the ARP cache.
-d : Deletes specified entry from the ARP cache.
-s : Adds a static entry in the ARP cache to associate the IP address
inet_addr with the hardware address phys_addr.

TMH Chapter - 12 65
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)
The arp utility

• To view current listing of the ARP cache entries on your computer use
arp -a.

• A static entry can be placed into the ARP cache by using arp -s.

• Entries can be deleted from the cache using arp -d.

TMH Chapter - 12 66
Network Essentials
TCP/IP
Address Resolution Protocol (ARP)
The arp utility

• If the destination host resides on a different network (determined by its


IP address) than the source host, ARP at the source host determines
hardware address of the default router.

• At the router a series of ARP requests and replies continues on each


network until the datagram reaches the destination host.

TMH Chapter - 12 67
Network Essentials
TCP/IP
Internet Control Message Protocol (ICMP)
• ICMP provides a mechanism for reporting errors due to datagram
delivery problems and helps in trouble-shooting TCP/IP problems.

• If the time-to-live (TTL) counter expires due to network congestion, or


the unavailability of the destination host, IP fails to deliver the datagram
and this generates an ICMP message called “network unreachable”.

• If a host is sending data faster that the receiving host can handle, the
receiver may generate an ICMP message called “source quench” to
inform the sending host that it should slow down.

TMH Chapter - 12 68
Network Essentials
TCP/IP
Internet Control Message Protocol (ICMP)

The ping utility

• The ping utility uses the ICMP “echo request” and “echo reply” packets
to determine whether a particular IP system on the network is functional.

• The ICMP packets start from the sending host and gets reflected back
from the destination host. ICMP messages are contained within IP
datagrams, which ensures that they will be able to find their way to the
appropriate target host.

TMH Chapter - 12 69
Network Essentials
TCP/IP
Internet Control Message Protocol (ICMP)
The ping utility

• To test TCP/IP on your own computer you can use the IP address
127.0.0.1. This address is called the “loopback address”.

C:\> ping 127.0.0.1

• The loopback address uses loopback drivers to reroute outgoing


packets back to the source computer. By going through the loopback
drivers the packets can bypass the network adapter card completely
and be returned directly to the computer that is performing the test.
TMH Chapter - 12 70
Network Essentials
TCP/IP
Transmission Control Protocol (TCP)

• TCP is a connection-oriented communications protocol that provides


reliable transfer of data. Larger messages are broken up and
transmitted as segments.

• TCP mechanism manage flow control and sequencing of packets to


guarantee that no data is lost during transmission.

• TCP operation is managed by data placed in a header that TCP adds to


the data to be transmitted.

TMH Chapter - 12 71
Network Essentials
TCP/IP
Transmission Control Protocol (TCP)

• The fields in the TCP header include :

TCP Source Port (16 bits) : Port number of source application.


TCP Destination Port (16 bits) : Port number of the receiving application.
Sequence Number (32 bits) : Sequence number of the current packet.
Acknowledgement Number (32 bits) : Sequence number of the next
packet the receiving host expects to receive.
Checksum (16 bits) : A checksum to verify the validity of the contents.

TMH Chapter - 12 72
Network Essentials
TCP/IP
Transmission Control Protocol (TCP)

• TCP is a connection oriented protocol and requires a session to be


opened between hosts that need to communicate. A session establishes
a formal dialog between hosts that enable error recovery to take place.

• Establishing a session is a three step process, called a “three-way


handshake” :
1. The sending host initiates a connection by sending a message to the
receiving host.
2. The receiving host responds to the message.
3. The sending host sends its first packet (segment) .

TMH Chapter - 12 73
Network Essentials
TCP/IP
Transmission Control Protocol (TCP)

• During the session for each segment sent the receiving host must return
an acknowledgement (ACK) within a specified period for the data
received.

• Reliability is achieved by using a checksum on both the header and the


data of each segment to reduce the chance of network corruption going
undetected.

• TCP also assigns a sequence number to each segment transmitted so


that any lost segments will be detected and re-transmitted.
TMH Chapter - 12 74
Network Essentials
TCP/IP
Transmission Control Protocol (TCP)

• It would be inefficient if the sending host had to wait for individual


acknowledgement of each segment that is sent. This would
double network traffic and also cause the sending host to spend
more time waiting than transmitting.

• Consequently TCP implements a mechanism called “Windowing”


that enables the receiving host to acknowledge multiple
segments with a single message.

TMH Chapter - 12 75
Network Essentials
TCP/IP
Transmission Control Protocol (TCP)

• When a session is established the hosts negotiate a window based on


the size of their receive buffers. Windowing works in the following
manner :

1. The sending host specifies a sequence number for each segment and
places them in its send buffer.

2. The segment is forwarded to IP which transmits it to the receiving


host.

TMH Chapter - 12 76
Network Essentials
TCP/IP
Transmission Control Protocol (TCP)

3. Segments are retained in the send buffer until they are


acknowledged. The sending host sets a timer that specifies how long it
will wait for an acknowledgement. If the acknowledgement does not
arrive in the specified time, the segment is re-transmitted.

4. When the segments arrive at the receiving host, the sequence


numbers are used to reassemble the segments in their original order.

TMH Chapter - 12 77
Network Essentials
TCP/IP
Transmission Control Protocol (TCP)

5. At some point the receiving host determines that a sequence of


segments has been received without any errors and has been
reassembled.

6.The receiving host transmits an acknowledgement that specifies the


number of bytes that has been received. The acknowledgement
includes the current window size.

7. When the sending host receives the acknowledgement, it discards


the acknowledged segments from the send buffer.
TMH Chapter - 12 78
Network Essentials
TCP/IP
User Datagram Protocol (UDP)

• UDP operates in the same layer as TCP. But in contrast to the reliable,
connection-oriented delivery provided by TCP, datagram delivery by
UDP is unreliable and connection-less.

• This is because UDP does not perform error checking to determine if a


datagram is delivered intact.

• If messages are short and updated frequently, it is not worth the effort
required to establish and maintain a session between two hosts. In
these cases UDP is used instead of TCP.
TMH Chapter - 12 79
Network Essentials
TCP/IP
User Datagram Protocol (UDP)

• UDP is also used for sending non-textual data like image and video,
where correctness of the data may not be so crucial.

• UDP also attaches a header to the data it receives from the upper-layer
protocols. These include the following fields :
UDP Source Port (16 bits) : Specifies the port number of the source
application.
UDP Destination Port (16 bits) : Specifies the port number of the
receiving application.
Message Length (16 bits) : The total length of the UDP packet.

TMH Chapter - 12 80
Network Essentials
TCP/IP
Reverse Address Resolution Protocol (RARP)
• ARP solves the problem of finding the hardware address corresponding
to an IP address. Sometimes the reverse problem has to be solved :
given a hardware address to find the IP address.

• This problem occurs when a diskless node is booted. Such a machine


will get the OS files loaded into its memory from a server, called OS
image.

• But to know its working IP address, it uses RARP which broadcasts its
hardware address and asks for its IP address from a RARP server.

TMH Chapter - 12 81
Network Essentials
TCP/IP
Reverse Address Resolution Protocol (RARP)
• The RARP server on getting the request, looks up a database of IP
addresses and sends back a IP address to be used for the current
session.

• Using RARP is better than embedding the IP address within the OS


image, because it allows the same image to be used for all diskless
nodes

TMH Chapter - 12 82
Network Essentials
DHCP
• One of the biggest problems in maintaining a TCP/IP network is the
difficulty in keeping track of all the IP addresses and host names.

• Dynamic Host Configuration Protocol (DHCP) helps with IP addressing


by using centralized databases to manage IP address configuration.

• The databases are stored on DHCP server which are configured to


hand out unique IP addresses to the clients as and when required by
them.

TMH Chapter - 12 83
Network Essentials
DHCP
• DHCP reduces the administrative burden of adding, moving and
configuring computers on TCP/IP networks by using a dynamic method
of IP address assignment.

• The two major components of DHCP are :


1. A protocol for communicating TCP/IP configuration parameters
between the DHCP server and client.
2. A service that manages requests from DHCP clients and maintains
the database of TCP/IP configuration parameters

TMH Chapter - 12 84
Network Essentials
DHCP
Benefits of using DHCP :

1. IP addressing information is accurately provided by a DHCP server


which reduces the chance of typing errors or duplicate or invalid IP
addresses.
2. IP addressing information is changed automatically when a computer is
moved to a different network.
3. The available and used IP addresses can be accurately monitored and
controlled, which is important for large networks with limited addresses.
4. Bulk information management, like changing addressing information for
all computers, can be centrally done on the DHCP server.

TMH Chapter - 12 85
Network Essentials
DHCP
• DHCP Server manages the requests from the DHCP clients and
maintains the database of TCP/IP configuration parameters.

• Within the Server, DHCP Manager is used to configure the basic IP


address settings and all optional parameters.

• DHCP Clients contact a DHCP Server to receive configuration


information such as IP address, subnet mask, default gateway address
etc.

TMH Chapter - 12 86
Network Essentials
DHCP
Phase I : IP Lease Request

• When a client first starts TCP/IP it sends a broadcast request called a


DHCPDISCOVER packet.

• If a client does not receive a response to a DHCPDISCOVER message


within 1 second, it makes three more attempts to obtain a lease at 9, 13
and 16 seconds intervals. If none of the attempts result in a lease offer
the client continues to try at five minute intervals.

TMH Chapter - 12 87
Network Essentials
DHCP
Phase I : IP Lease Request

TMH Chapter - 12 88
Network Essentials
DHCP
Phase II : IP Lease Offer

• All DHCP Servers that receive the DHCPDISCOVER packet determine


if they can offer an address lease.

• A DHCP Server that can offer a lease, selects an unavailable IP


address from the DHCP database and sends it to the client using a
DHCPOFFER packet.

• The DHCP Server temporarily reserves the IP address so that it will not
be offered to any other DHCP clients.

TMH Chapter - 12 89
Network Essentials
DHCP
Phase II : IP Lease Offer

TMH Chapter - 12 90
Network Essentials
DHCP
Phase III: IP Lease Select

• The client selects the IP address information from the first offer that it
receives and responds to the DHCP Server by broadcasting a
DHCPREQUEST packet confirming selection of the offered IP address.

• The other servers also receive the broadcast and retract their offers.

TMH Chapter - 12 91
Network Essentials
DHCP
Phase III: IP Lease Select

TMH Chapter - 12 92
Network Essentials
DHCP
Phase IV: IP Lease Acknowledgement

• The DHCP Server acknowledges the client’s request by sending back a


DHCPACK packet. The Server also sends any optional parameters if
applicable.

• The IP address and other configuration settings are saved on the DHCP
client so that the client can attempt to renew its previous settings.

TMH Chapter - 12 93
Network Essentials
DHCP
Phase IV: IP Lease Acknowledgement

TMH Chapter - 12 94
Network Essentials
DHCP
Phase V: IP Lease Renewal

• A DHCP client automatically attempts to renew its IP address when 50%


of its lease time has expired.

• The client now sends a DHCPREQUEST message directly to the DHCP


server from which it originally received the lease.

• If the server is available it sends the client the updated configuration


including the new IP lease expiration date and time.

TMH Chapter - 12 95
Network Essentials
DHCP
Phase V: IP Lease Renewal

• If the server is unavailable at the 50% time interval, the client continues
to attempt to renew the lease while continuing to use the IP address
until 87.5% of the lease time has expired.

• If the DHCP server is still unavailable the client will broadcast a


DHCPREQUEST message to which any DHCP server will respond.

• The new DHCP Server may be able to renew the lease or send a
message indicating that the lease should be terminated which causes
the client to initiate the leasing of a new IP address.

TMH Chapter - 12 96
Network Essentials
Routing
• IP Routing is the process of choosing a path through the routers of an
inter-network to enable IP datagrams to be delivered to a destination
host on a remote network.

• A “router” is the computer that makes the choices of where the packets
will be sent. Routers behave like a post-office.

• Because they make use of the network identifiers, routers operate on


the Network layer of the TCP/IP stack. Routers match each packet
header to a network segment and choose the best path for the packet,
optimizing network performance.

TMH Chapter - 12 97
Network Essentials
Routing
• Although routers are specialized computers dedicated to perform
routing, it is possible to configure a Windows NT computer to be a router
by installing multiple network cards, each attached to a different
network.

• When the sending host and receiving hosts lie on the same network, no
separate router is required.

• Here IP uses ARP to get the hardware address of the destination host.

TMH Chapter - 12 98
Network Essentials
Routing
• When the TCP/IP software on the sending host has determined that the
destination lies on another network (by its IP address), the datagram is
sent to a default gateway.

• Delivery of the datagram to the remote host is left up to the router, which
makes routing decisions on how best to deliver the datagram.

• The IP address, subnet mask and default gateway address are all used
to build the initial entries in the routing table.

TMH Chapter - 12 99
Network Essentials
Routing
• A routing table will include the following fields :
Network Address : IP address of the destination network.
Gateway Address : Specifies where the packet needs to be sent if a
match is found in the routing table. This address must be associated
with a router interface on the local network.
Metric : Specifies the preference level for the route. If a given
destination has multiples routes, the router will prefer those entries
having the lowest metric number. Typically it reflects the hop count of
the route.

TMH Chapter - 12 100


Network Essentials
Routing
• Routing involves two basic activities : determining optimal routing paths
and transporting data packets through an internetwork.

• Routing protocols use metrics to evaluate what path will be the best for
a packet to travel.

• A metric is a standard of measurement, such as physical length, number


of hops or transmission delay, that is used by routing algorithms to
determine optimal path to a destination.

• To aid the process of path determination, routing algorithms initialize


and maintain routing tables which contain route information. Route
information varies according to the routing algorithm used.

TMH Chapter - 12 101


Network Essentials
Routing

TMH Chapter - 12 102


Network Essentials
Routing
• To aid the process of path determination, routing algorithms initialize
and maintain routing tables which contain route information. Route
information varies according to the routing algorithm used.

• “Next hop” associations tell a router that a particular destination can be


reached optimally by sending the packet to a particular router
representing the next stop on the way to the final destination.

• Routing tables also contain other information such as preference of a


path.

• In general routers communicate with one another and maintain their


routing tables through the transmission of a variety of messages.

TMH Chapter - 12 103


Network Essentials
Routing
• Switching algorithms are relatively simple and is essentially the same for
most routing protocols.

• In most cases the router determines that it must send the packet to
another host.

• The next hop may be the ultimate destination host, otherwise it is


another router.

TMH Chapter - 12 104


Network Essentials
Routing
• Routing algorithms can be differentiated based on several key
characteristics.

Design Goals

• Routing algorithms usually have one or more design goals : optimality,


simplicity and low overhead, robustness and stability, rapid
convergence.

• Optimality refers to the capability of the routing algorithm to select the


best route based on metrics and weightage allocated to each metric.

• For example one routing algorithm may use both number of hops and
delay as metrics, but it may give more weightage to delay factor.

TMH Chapter - 12 105


Network Essentials
Routing
Design Goals

• Routing algorithms are also designed to be as simple as possible. This


means that the routing algorithm must offer its functionality efficiently,
with minimum resource overheads.

• Efficiency is particularly important when the computer on which it runs


has limited physical resources.

• Routing algorithms must be robust, which means that they should


perform correctly in the face of unusual or unforeseen circumstances,
such as hardware failures, high load conditions etc.

TMH Chapter - 12 106


Network Essentials
Routing
Design Goals

• Routing algorithms should converge rapidly. Convergence is the


agreement of all routers on which route is regarded as optimal.

• Periodically neighbouring routers exchange messages regarding


network conditions, using which the algorithms recalculate optimum
routes. Algorithms should quickly make such decisions.

TMH Chapter - 12 107


Network Essentials
Routing
Algorithm Types

• Static algorithms are table mappings established by the network


administrator before routing starts. These mappings do not change
unless done so manually.

• Static routing algorithms are simple to design and work well in


environments where network traffic is relatively predictable.

• Dynamic routing algorithms adjust to changing networks by analyzing


incoming routing messages.

• If the messages indicate a change in network, routing software


recalculates routes and sends out new routing update messages.

TMH Chapter - 12 108


Network Essentials
Routing
Algorithm Types

• Multi-path algorithms permit multiplexing of data packets over multiple


lines thereby increasing throughput compared to single-path algorithm
which can send data along a single path only.

• In a flat routing system, routers are all peers of others. In a hierarchical


routing system some routers form a routing backbone. Packets are sent
through backbone routers until they reach the general area of
destination.

• Link state routing algorithms send small updates to a large number of


neighbouring routers. Distance vector algorithms send larger updates to
smaller number of neighbouring routers. Link-state algorithms are more
expensive to implement and require more resources but deliver
improved performance.
TMH Chapter - 12 109
Network Essentials
Routing
Routing Metrics

• Path length is the most common metric. Some algorithms allow network
administrators to assign arbitrary costs to each network link. In this case
path length is the sum of costs associated with each path.

• Other algorithms use geographical distance or hop counts as the path


length metric.

• Routing delay refers to the time required to move packets along a


specific path. Depends on physical distance, bandwidth, network load
and congestion etc.

TMH Chapter - 12 110


Network Essentials
Static Routing Algorithms
Shortest Path Routing

• This is one of the most simple and popular static routing algorithms. The
idea is to build a graph of the network, with each node representing a
router and each line representing a link between associated routers.

• One way of measuring path length is the number of hops. Using this
metric ABC and ABE are of equal lengths.

• Another metric is the geographical distance. In this case ABC is much


longer than ABE.

• Another metric is the amount of transmission delay between two nodes.


In this case the fastest path is the shortest path, rather than the number
of hops or geographical distance.

TMH Chapter - 12 111


Network Essentials
Static Routing Algorithms
Shortest Path Routing

TMH Chapter - 12 112


Network Essentials
Static Routing Algorithms
Shortest Path Routing

• In the general case a combined metric could be computed as a function


of distance, bandwidth, number of hops, communication costs,
transmission delays etc.

• Different weightages could be assigned to factors which are more


crucial.

• Number of hops, distance, delays etc. could be physically computed by


transmitting ICMP echo packets from each node and calculating the
time it takes to reflect them from neighbouring nodes.

TMH Chapter - 12 113


Network Essentials
Static Routing Algorithms
Shortest Path Routing

• Let us assume that transmission delay is considered as the metric.


Using the procedure of echo packets let the distance between each
node be labeled as shown. It is required to find the shortest path from A
to D.

• Each node is labeled with its distance from the source node.Initially no
paths are known so all nodes are labeled with infinity.

• As the algorithm proceeds better paths are found and their labels
changed to reflect this

TMH Chapter - 12 114


Network Essentials
Static Routing Algorithms
Shortest Path Routing

TMH Chapter - 12 115


Network Essentials
Static Routing Algorithms
Shortest Path Routing

• A label can be either tentative or permanent.

• Initially all labels are tentative. When it is discovered that a label


represents the shortest path from the source node to that node, it is
made permanent.

• We start out by making node A permanent. Then we examine each of


the nodes adjacent to A (working node), relabeling each one with
distance to A.

• Out of all the relabeled nodes we make the one with the smallest label
permanent.This becomes the new working node.

TMH Chapter - 12 116


Network Essentials
Static Routing Algorithms
Shortest Path Routing

• We now start at B and examine all nodes adjacent to it. If the sum of the
label on B and the distance from B to the node being considered is less
than the label on the node, we have a shorter path, and the path is
relabeled.

• After all adjacent nodes have been labeled tentatively, we find the node
with the smallest label value and make it permanent. This becomes the
next working node.

• This process is continued until the destination node D is reached.

TMH Chapter - 12 117


Network Essentials
Static Routing Algorithms
Flooding

• Another static routing algorithm is called flooding. Here every incoming


packet is sent out on every outgoing line except the one it arrived on.

• Flooding obviously generates a vast number of duplicate packets and


some measures are required to damp the process.

• One such measure is to have a hop counter contained in the header of


each packet, which is decremented at each hop, with the packet being
discarded when the counter reaches zero.

• Flooding is not practical in most applications, but it does have some


uses.

TMH Chapter - 12 118


Network Essentials
Static Routing Algorithms
Flooding

• In military applications, the tremendous reliability and robustness of


flooding may be desirable.

• In distributed database applications, it is some times desirable to update


all databases concurrently.

• In wireless networks, all messages transmitted by a station can be


received by all other stations within its radio range.

• Flooding may also be used as a benchmark against which other


algorithms can be compared. Since flooding chooses every possible
path in parallel, it produces the shortest delay (ignoring the overhead
caused by the flooding process itself).

TMH Chapter - 12 119


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

• Modern computer networks generally use dynamic routing algorithms


rather than static ones, because static algorithms do not take current
network load into account.

• One of the most popular dynamic routing algorithms is the distance


vector routing, also called Bellman-Ford algorithm after the researchers
who developed it. It is used by the Routing Information Protocol (RIP).

• Each router maintains a table, called a vector, giving the best known
distance to each destination and which line to use to get there. These
tables are updated by exchanging information with its neighbours.

TMH Chapter - 12 120


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

• Let us assume that delay is chosen as the metric, and each router
knows the delay to each of its neighbours.

• Once every T seconds each router sends to each neighbour a list of its
estimated delays to each destination.

• Let us suppose that one of the tables has just come in from neighbour X
with m seconds being X’s estimate how long it takes to get to router Y.

• If the current router knows that the delay to reach X is n seconds, then it
concludes that it can reach Y in m+n seconds via AXY.

TMH Chapter - 12 121


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

TMH Chapter - 12 122


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

• Similarly based on the table from neighbour Z, A can estimate that it can
also reach Y in p+q second via path AZY.

• By performing this calculation for each neighbour, a router can find out
which estimate seems the best, and update that value in its routing
table. In this case whichever is smaller m+n or p+q will be entered.

• Later on due to varying network conditions the delay between X and Y


may change to m’ while that between A and X may change to n’.

• Similarly the delay between A and Z may change to p’ and that between
Z and Y may change to q’. The router A will then again compute the
values of m’+n’ and p’+q’ and update its table with the smaller value.

TMH Chapter - 12 123


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

• Two things are to be noted here. First that each routing table contains
entries for all routers, not only the neighbours.

• However the tables are transmitted only to the neighbours, not all
routers e.g. A’s table is transmitted only to X and Z.

• Another thing which might be pointed out is that delay in sending


messages from A to X would in general be different from the delay in
sending messages from X to A due to the available buffer and load
conditions of the machine.

TMH Chapter - 12 124


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

• Distance vector routing has a serious drawback, known as the Count to


Infinity problem. It converges quickly to good news but slowly to bad
news.

• Consider a five-node bus network where the delay metric is the number
of hops. Suppose A is down initially and all routers know this.

• When A comes up the other routers learn about it via vector exchanges.
At the time of the first exchange, B learns that A is up and one hop away
to the left. All other routers think A is still down.

TMH Chapter - 12 125


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

TMH Chapter - 12 126


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

• On the next exchange C learns that B has a path length of 1 to A. So it


updates its routing table to indicate a path length of 2 to A. D and E still
do not know of the good news.

• Thus the good news is spreading at the rate of 1 hop per exchange .

• Now let us consider a situation that A is initially up and all routers know
about it. Suddenly A goes down. In the first exchange, B does not hear
from A. But C says, “Don’t worry I have a path of length 2 to A”.

• B does not know C’s path runs through B itself. As a result B thinks that
it can reach A via C, and updates its routing table with a path length of 3
for A.

TMH Chapter - 12 127


Network Essentials
Dynamic Routing Algorithms
Distance Vector Routing

• On the second exchange C notices that each of its neighbours claim to


have a path length of 3 to A. C then updates its table with a new path
length of 4 for A.

• In the third exchange, both B and D notices that C has a path length of 4
to A. Both B and D update their tables with a path length of 5 for A.

• This process takes a long time to converge, each router gradually


coming to know that A is down.

TMH Chapter - 12 128


Network Essentials
Dynamic Routing Algorithms
Link State Routing

• Because of the count-to-infinity problem, distance vector routing


algorithm was subsequently replaced by a new algorithm called link
state routing.It is implemented in the Open Shortest Path First (OSPF)
protocol.

• There are five phases which each router must do.

Discover about the Neighbours :

• When a router is switched on, its first task is to learn who its neighbours
are. It accomplishes this by sending ICMP packets to each of its
neighbours and getting a reply from them.

TMH Chapter - 12 129


Network Essentials
Dynamic Routing Algorithms
Link State Routing

Measuring Line Cost :

• Each router is expected to know the delay to each of its neighbours.


This can be done by measuring the time it takes for the ICMP packets to
be reflected back from them.

Building link state packets :

• Once the information needed for the exchange has been collected the
next step is for each router to build a packet containing all the data.

• The packet starts with the identity of the sender followed by a sequence
number and age, followed by delay to each of the neighbours.

TMH Chapter - 12 130


Network Essentials
Dynamic Routing Algorithms
Link State Routing

Distributing link state packets :

• The packets are then distributed and installed on each of the routers.
The basic distribution mechanism involves flooding.

• To keep the flood in check, each packet contains a sequence number


which is incremented for each new packet sent, and age which is
decremented once per second. Routers keep track of all the (source
router, sequence) pairs they see.

TMH Chapter - 12 131


Network Essentials
Dynamic Routing Algorithms
Link State Routing

Distributing link state packets :

• When a new link state packet comes in, it is checked against the list of
packets already seen. If it is new, it is forwarded on all lines except the
one it arrived on

• If it is a duplicate it is discarded. If a packet with a lower sequence


number arrives, it is also rejected since the router has more recent data.

TMH Chapter - 12 132


Network Essentials
Dynamic Routing Algorithms
Link State Routing

TMH Chapter - 12 133


Network Essentials
Dynamic Routing Algorithms
Link State Routing

Computing new routes :

• Once a router has accumulated a full state of link state packets it can
construct the entire network graph because every link is represented.

• Now the shortest path algorithm can be used to compute shortest path
to all possible destinations, and the result can be installed in the routing
table.

TMH Chapter - 12 134


Network Essentials
Dynamic Routing Algorithms
Link State Routing

• Some problems can occur with this algorithm. First if the sequence
numbers wrap around there would be confusion.

• The solution is to use a 32-bit sequence number, which will take a long
time to wrap around (137 years with one packet sent per second).

• Second if a router crashes, it will lose track of its sequence number. If it


starts again at 0, the next packet will be regarded as a duplicate.

• Third if a sequence number if ever corrupted, a 1-bit error may cause


the routers to interpret 4 (100) as 65540 (10000000000000100). All
packets from 5 to 65540 will be rejected as obsolete

TMH Chapter - 12 135


Network Essentials
Hierarchical Routing
• As networks grow in size, the routing tables grow proportionally. This
requires more memory as well as more processing time to scan the
tables and send reports about them.

• At a certain point, it may no longer be feasible for every router to have


an entry for every other router. In such cases hierarchical routing is
used.

• Here routers are divided into regions, with routers knowing the details of
all routers in the same region but not about routers of all regions.

TMH Chapter - 12 136


Network Essentials
Hierarchical Routing
• Consider a two-level hierarchy with five regions. The full routing table for
router 1A has 17 entries..

• When routing is done hierarchically there are entries for all local routers
but each external region has entry for a single router. Traffic for region 2
goes via 1B-2A line and so the number of entries is reduced from 7 to 4.

TMH Chapter - 12 137


Network Essentials
Host Name Resolution
• All Windows based computers are assigned user-friendly name to
simplify connection from one computer to another. These are called
Host Names.
• Host Names provide a method of assigning an alias to a computer so
that a user need not remember the host’s IP address.
• The host name can be of any combination of the letters A through Z, the
numerals 0 through 9, and the hyphen (-), with the period (.) character
used as a separator.

TMH Chapter - 12 138


Network Essentials
Host Name Resolution
• The hostname utility is used to display the host name assigned to a
computer.
C:\> hostname
Sales1
• Host names are commonly used with TCP/IP utilities such as ping or
FTP. A user can type ping accounting.quicklearn.com instead
of ping 172.25.16.11
• Host Name Resolution is the process of determining IP address
associated with a host name.

TMH Chapter - 12 139


Network Essentials
Host Name Resolution
• Host names must be resolved to IP addresses and IP addresses must
be resolved to hardware addresses for hosts to communicate with one
another.
• TCP/IP supports several different methods of host name resolution
including :
(1) HOSTS file
(2) Domain Name Server (DNS)

TMH Chapter - 12 140


Network Essentials
Host Name Resolution
HOSTS file
• The HOSTS file is a text file maintained on a local host. It contains
entries consisting of IP addresses corresponding to host names.
• The HOSTS file on a Windows NT computer must reside in the directory
C:\system32\drivers\etc.
• More than one name can be included for each IP address. Any
character following the # character are treated as comments and
ignored when the file is processed. Thus host names cannot contain the
# character.
• Host names in the HOSTS file are not case sensitive and are
conventionally entered in lowercase.

TMH Chapter - 12 141


Network Essentials
Host Name Resolution
HOSTS file
• When a user types a command using a host name (for example ping
hostb) TCP/IP performs the following steps :
1. It checks to see if the host name specified is the same as the local
host’s name. If the two are the same the local host can resolve the host
name directly.
2. If the host name specified is different from the local host’s name, the
local HOSTS file is checked to see if there is an entry for the requested
host name.
3. If the host name is found it is resolved to an IP address. If the host
name cannot be resolved, the resolution process terminates with an
error message unless the computer has been configured to use DNS or
WINS.

TMH Chapter - 12 142


Network Essentials
Host Name Resolution
Domain Name System (DNS)
• In the early days of TCP/IP networking, when number of available
computers on the Internet was quite small, the HOSTS file was sufficient
to maintain the mappings. It was downloaded periodically from a
computer on the Internet.
• As the Internet grew the number of hosts increased dramatically, and
maintaining the list using HOSTS files became unmanageable. It was
realized that a central database to handle the name resolution was
necessary.
• A new hierarchical naming scheme called the Domain Name System
(DNS) was developed. Using DNS the name space could be partitioned
into different domains and multiple servers could be used for name
resolution.
TMH Chapter - 12 143
Network Essentials
Host Name Resolution
Domain Name System (DNS)
• The three main components of DNS are : name resolvers, domain name
space and name servers.
• In DNS terminology, DNS clients are called Resolvers. The resolver
queries the DNS server to obtain the IP address of the requested host.
• The resolver software is usually built into an application or provided as
part of the OS on the host computer
• The DNS database is organised in a tree structure called the domain
name space. Each domain is named and can contain sub-domains.
• DNS domains define different levels of authority in a hierarchy. These
levels are root domain, top-level domains and second-level domains.

TMH Chapter - 12 144


Network Essentials
Host Name Resolution
Domain Name System (DNS)

• The highest level of the hierarchy is the root domain. All other domains
fall below it.
• The next level in the hierarchy is divided into a series of nodes called
the top-level domains.
• These are assigned by the type of organization and by the country.
• The top level domain space is divided into two primary areas :
organizational domains and geographical domains.
• Each top-level domain is identified by a three-character code to indicate
the primary function of an organization that has obtained it

TMH Chapter - 12 145


Network Essentials
Host Name Resolution

TMH Chapter - 12 146


Network Essentials
Host Name Resolution
Domain Name System (DNS)

• Organizational domains are shown below :


.com : Indicates commercial organizations e.g. microsoft.com
.edu : Indicates educational institutions e.g. mit.edu
.gov : Indicates government organizations e.g. indianrailways.gov
.mil : Indicates military organizations
.org : Indicates non-profit organizations e.g. unicef.org
.net : Indicates networking organizations e.g. vsnl.net

TMH Chapter - 12 147


Network Essentials
Host Name Resolution
Domain Name System (DNS)
• Organizational domains were originally used only in the US. As the
Internet grew it became necessary to introduce geographical domains to
identify countries.
• A two character code has been adopted to denote the name of the
country e.g. .au (Australia), .ca (Canada), .jp (Japan), .in (India), .fr
(France) etc.
• Below the top-level domains are the second-level domains. Usually
these are associated with organizations e.g. ibm.com or vsnl.net or
unicef.org
• If an organization decides it wants its domain name to be available on
the Internet it must register a second-level name under the appropriate
top level domain. In majority of cases second-level domains are
registered by the InterNIC.
TMH Chapter - 12 148
Network Essentials
Host Name Resolution
Domain Name System (DNS)
• DNS Name Servers store information about portions of the domain
name space.
• The name server is the computer running the programs that manage the
DNS database.
• Name servers can either respond directly to a request for information by
performing a lookup of the database or pass the request to other name
servers.
• Requests to a DNS name server can be of two types : a recursive query
occurring between a DNS client and DNS name server, and an iterative
query between two name servers.

TMH Chapter - 12 149


Network Essentials
Host Name Resolution
Domain Name System (DNS)
• With a recursive query, a request is made to the DNS name server to
respond with the requested data or return an error message.
• The server receiving the recursive query is responsible for resolving it
and cannot forward the request to another server. It can however make
iterative queries to another server.
• An iterative query typically occurs between name servers attempting to
resolve a recursive query from a client. Typically this is a reference to
another server that may be able to fulfil the client’s original request.

TMH Chapter - 12 150


Network Essentials
Host Name Resolution
Domain Name System (DNS)

• The request is first sent from the client to the local DNS server that the
client has been configured to use. This is a recursive query

• The local DNS server sends an iterative query to a root name server,
which responds with the IP address of a machine containing information
about the .com domain

• The request is then sent from the local DNS server to the .com name
server which responds with the IP address of a machine containing
information about the quicklearn.com domain

TMH Chapter - 12 151


Network Essentials
Host Name Resolution
Domain Name System (DNS)

• The request is then sent from the local DNS server to the name server
for the quicklearn.com domain. It responds with the IP address of
the actual machine www.quicklearn.com
• If DNS does not respond after several attempts then the resolution
process terminates with an error

TMH Chapter - 12 152


Network Essentials
Host Name Resolution
Domain Name System (DNS)

TMH Chapter - 12 153


Network Essentials
Access Methods
• The data-link layer provides the means to transfer data between
adjacent nodes in a network. It is also related to detection of errors in
the raw bit stream of the physical layer.

• It takes the packet from the network layer, adds its own header and
trailer to create a frame and hands it over to the physical layer to be
transmitted.

• The header portion includes the 48-bit hardware address of the source
and destination nodes. The trailer includes a checksum for error
detection.

• Examples of data-link protocols are Ethernet (also called IEEE 802.3)


and Token Ring (also called IEEE 802.5)

TMH Chapter - 12 154


Network Essentials
Access Methods
• The data-link layer is made up of two components. The first is
called Logical Link Control (LLC sublayer) and determines the
structure of the frames themselves.

• The second component called Media Access Control (MAC


sublayer) and determines who is allowed to access the media at
any one time.

• A scheme called Carrier Sense Multiple Access / Collision Detect


(CSMA/CD) governs the way nodes share a single channel.

• CSMA is a “probabilistic” mode of transfer since there is no


guarantee that a particular node will be able to transmit within a
specific time interval.
TMH Chapter - 12 155
Network Essentials
Access Methods
• This method is usually used for networks with light and medium
traffic, because for high traffic there may be too many collision
for proper functioning.
1. Start - if the wire is idle, otherwise go to step 4.
2. If a collision is detected, go to step 4.
3. End successful transmission and report success to upper layer
4. Wire is busy - wait until wire becomes idle.
5. Wire just became idle, wait a random time and go to step 1.
6. Maximum number of attempts exceeded - report failure to higher
layer

TMH Chapter - 12 156


Network Essentials
Access Methods
• Since hosts transmit as soon as they find the cable to be free,
unnecessary delays are avoided resulting in optimum use of the
medium.
• Since hosts may have to wait a long time before getting a chance to
transmit on heavily loaded networks, this method may not be used to
send critical or urgent data.
• The second access method is called Token Ring Passing method,
which is called a “deterministic” model as all hosts get a chance to
transmit.
• In this method, a token, consisting of a string of bits, is passed around
all the hosts one after another.
• Each host can hold the token for a pre-defined amount of time before
handing it over to the next host.

TMH Chapter - 12 157


Network Essentials
Access Methods
• The host which holds the token at a point of time has exclusive rights to
transmit over the cable while the other hosts can only listen.
• This method is usually used for heavily loaded networks or where critical
or urgent data needs to be transmitted as there is a guarantee that each
host will be able to transmit after a specific amount of time.
• This is not used for lightly loaded networks because hosts which do not
need to transmit may be holding the token causing unnecessary delays.
• Token ring networks initially considered significantly superior in
performance and reliability than shared media Ethernet.
• However with the development of switched Ethernet, token ring
architectures have lagged behind in usage and cost.

TMH Chapter - 12 158

You might also like