Professional Documents
Culture Documents
CN Unit-3 Imp QA's
CN Unit-3 Imp QA's
What is impact of node/switch only packets at node are all virtual circuits through node
crash? lost fail
3) What are adaptive and non-adaptive routing algorithms? Explain all of them in
detail(Or) What are static and dynamic routing algorithms? Explain all of them in
detail (or) Explain the Distance Vector routing algorithm with a suitable example for
calculating the route. Also give its merits and demerits. (or) Explain about link state
routing algorithm with an example. (or) How are routing algorithms classified? Explain
the shortest path routing by means of an example(or) What is flooding? (or) Explain
the advantages and disadvantages of flooding as a routing algorithm. (V. V. IMP 5/10
m) (Any one Routing Algorithm)
Ans: The routing algorithm is that part of the network layer software responsible for deciding
which output line an incoming packet should be transmitted on.
Routing is the process of selecting best paths in a network.
Routing algorithms can be grouped into two major classes: nonadaptive (Static) and
adaptive(Dynamic).
Nonadaptive algorithms do not base their routing decisions on measurements or estimates of
the current traffic and topology.
Adaptive algorithms, in contrast, change their routing decisions to reflect changes in the
topology, and usually the traffic as well. Adaptive algorithms differ in where they get their
information, when they change the routes, and what metric is used for optimization.
Non-AdaptiveRoutingAlgorithms:•Shortestpathrouting • Flooding
(a).ShortestPathRouting: Itisusedtobuildagraphofthesubnet,witheachnodeofgraph
representingarouterandeach arcof thegraphrepresentingacommunicationline.Tochoosea
routebetweenagivenpairofrouters,thealgorithmjustfindstheshortestpathbetweenthemon
thegraph.Differentwaysofmeasuringthepathlengthisthe numberof Hops,Geographical
distanceinkmts,MeanQueuingdelay,Transmissiondelay,Functionsof distance,Bandwidth,
Averagetraffic,communicationcostetc.,
Eg:- Tocomputeshortestpath from‘A’ to‘D’:-
(i).Node‘A’ispermanentandadjacent nodesfor‘A’arefoundinthisstage.
(ii).Adjacentnodesof‘A’arerelabeledwithdistancefrom‘A’,andnodewith
minimumvaluebecomespermanent. Here,node‘B’.
(iii).Adjacentnodesof ‘B’arerelabeledwithdistancefrom‘A’,andnode
withminimumvaluebecomes permanent.Here,node‘E’.
(iv).Adjacentnodesof ‘E’arerelabeledwithdistancefrom‘A’,andnodewith
minimumvaluebecomespermanent. Here,node‘G’.
(v).Adjacentnodesof‘G’arerelabeledwithdistancefrom‘A’,andnodewith
minimumvaluebecomespermanent. Here,node‘F’.
Finally,Destination‘D’isrelabeledasD(10,H).Thepath is(D-H-F-E-B-A)asfollows:
D(10,H) = H(8,F)
= F(6,E)
= E(4,B)
= B(2,A)
= A
Flooding: Ifeveryincomingpacketissentoutoneveryoutgoinglineexcepttheoneit
arrivedon,itiscalledFlooding
Floodinggeneratesvastnumbersof duplicatepackets.Todampthisprocess,several
techniquescanbeemployed:
1. Tohaveahopcountercontainedintheheaderofeachpacket,whichisdecrementedat
eachhop,withthepacketbeingdiscardedwhenthecounterreaches‘zero’.Initially,the
hopcountershouldbeinitializedtothelengthofthepathfromsourcetodestination.
2. Tokeeptrackofwhichpacketshavebeenfloodedsothattheycanbeavoidedsending
secondtime.Thisisachievedby havingthesourcerouterputasequencenumberineach
packetitarrivesfromitshosts.Eachrouterthenneedsalistpersourceroutertelling which sequence
numbers originating at that source have already been seen. If an incomingpacketisonthelist,
itisnotflooded.
Adaptiveroutingalgorithms:
1. Distance vector routing Algorithm or 2. Link State routing algorithm
1.DistanceVectorRouting:
This algorithm operates byhaving each router maintain a table giving the best known
distancetoeachdestinationandwhichlinetouse togetthere.Thesetablesare updatedby
exchanginginformationwiththeneighbors.ThisalgorithmisalsocalledasBELLMAN-FORD
orFORD-FULKERSON algorithm.Inthisalgorithm,eachroutermaintainsaroutingtable
indexedbyandcontainingoneentryforeachrouterinsubnet.Thisentrycontains2parts:Thepreferredout
goinglinetousefor thatdestination, anestimateoftimeor
distance(noofhops,ortimedelayorqueuelength) forthat destination.
● In distance vector routing, the least-cost route between any two nodes is the route with
minimum distance.
● In this protocol, as the name implies, each node maintains a vector (table) of minimum
distances to every node. The table at each node also guides the packets to the desired
node by showing the next stop in the route (next-hop routing).
Initialization
● The tables in Figure are stable; each node knows how to reach any other node and the
cost. At the beginning, however, this is not the case. Each node can know only the
distance between itself and its immediate neighbors, those directly connected to it.
● Figure shows the initial tables for each node. The distance for any entry that is not a
neighbor is marked as infinite (unreachable).
● Indistance vector routing, each node shares its routing table with its immediate neighbors
periodically and when there is a change.
● When a node receives a two-column table from a neighbor, it needs to update its routing
table. Updating takes three steps:
● 1. The receiving node needs to add the cost between itself and the sending node to each
value in the second column. The logic is clear. If node C claims that its distance to a
destination is x mi, and the distance between A and C is y mi, then the distance between
A and that destination, via C, is x + y mi.
● 2. The receiving node needs to add the name of the sending node to each row as the third
column if the receiving node uses information from any row. The sending node is the
next node in the route.
● 3. The receiving node needs to compare each row of its old table with the corresponding
row of the modified version of the received table.
● a. If the next-node entry is different, the receiving node chooses the row with the smaller
cost. If there is a tie, the old one is kept.
● b. If the next-node entry is the same, the receiving node chooses the new row. For
example, suppose node C has previously advertised a route to node X with distance 3.
Suppose that now there is no path between C and X; node C now advertises this route
with a distance of infinity. Node A must not ignore this value even though its old entry is
smaller. The old route does not exist any more. The new route has a distance of infinity.
● Figure shows how node A updates its routing table after receiving the partial table from
node C.
● The modified table shows how to reach A from A via C. If A needs to reach itself via C,
it needs to go to C and come back, a distance of 4. The only benefit from this updating of
node A is the last entry, how to reach E. Previously, node A did not know how to reach E
(distance of infinity); now it knows that the cost is 6 via C.
Problems: Uses queue length as metric rather than time delay, did not take into account line
bandwidth. Takes long time to converge, spreading good news (shorter metrics) quickly, but bad
news (failure on subnet) slowly.
2.Link State Routing -
Currently widely used on Internet. Determines complete topology and delays to neighbors, then
distributes to all other routers so that each can compute shortest path to any router
1. Discover neighbor’s addresses by sending ECHO packet on all outgoing lines.
2. Measure the cost to each of its neighbors (time to receive ECHO response divided by
two). To include load as a factor the timer is started when ECHO packet placed in queue,
to ignore load the timer is started when ECHO packet reaches head of queue.
Using load can cause oscillation when two parallel paths are available since the load will
be shifted back and forth to the lowest delay channel.
3. Construct packet containing all information about neighbors just learned. Creation of
Link State Packet (LSP): A link state packet can carry a large amount of information.
Like,the node identity, the list of links, a sequence number, and age. The first two, node
identity and the list of links, are needed to make the topology. The third, sequence
number, facilitates flooding and distinguishes new LSPs from old ones. The fourth, age,
prevents old LSPs from remaining in the domain for a long time. LSPs are generated on
two occasions:
1. When there is a change in the topology of the domain. Triggering of LSP
dissemination is the main way of quickly informing any node in the domain to update its
topology.
2.On a periodic basis. The period in this case is much longer compared to distance vector
routing. It is done to ensure that old information is removed from the domain. The timer
set for periodic dissemination is normally in the range of 60 min or 2 h based on the
implementation.
4. Distribute packet to all other routers. Flooding of LSPs: After a node has prepared an
LSP, it must be disseminated to all other nodes, not only to its neighbors. The process is
called flooding and based on the following:1. The creating node sends a copy of the LSP
out of each interface.2. A node that receives an LSP compares it with the copy it may
already have. If the newly arrived LSP is older than the one it has (found by checking the
sequence number), it discards the LSP. If it is newer, the node does the following:
a. It discards the old LSP and keeps the new one.
b. It sends a copy of it out of each interface except the one from which the packet arrived.
This guarantees that flooding stops somewhere in the domain (where a node has only one
interface). Flooding used to distribute with a sequence number for each new packet sent.
Routers keep track of (router, sequence number, age), remembering and forwarding the
highest sequence numbered ones and discarding duplicates and lower sequence numbered
ones as a means of stemming the flood.
5. Each router computes shortest path to all otherrouters using most current information
from other routers, store in table containing router and output line to router to
use.Formation of Shortest Path Tree: Dijkstra Algorithm: After receiving all LSPs,
each node will have a copy of the whole topology. However, the topology is not
sufficient to find the shortest path to every other node; a shortest path tree is needed.
Problems – Heavy traffic due to flooding of packets. Flooding can result in infinite looping
which can be solved by using Time to live (TTL) field.
4) Explain the IPv4 Header with the help of a neat diagram. State two differences IPv6 has
in comparison to IPv4. (or) With a neat sketch explain the different fields of IP
header.(V.V. IMP 5/ 10m)
Ans: IPv4 is an unreliable and connectionlessdatagramprotocol-a best-effort delivery service.
The term best-effort means that IPv4 provides no error control or flow control (except for error
detection on the header).
● IPv4 assumes the unreliability of the underlying layers and does its best to get a
transmission through to its destination, but with no guarantees.
● If reliability is important, IPv4 must be paired with a reliable protocol such as TCP.
● IPv4 is also a connectionless protocol for a packet-switching network that uses the
datagram approach. This means that each datagram is handled independently, and each
datagram can follow a different route to the destination. This implies that datagrams sent
by the same source to the same destination could arrive out of order.
● Also, some could be lost or corrupted during transmission. Again, IPv4 relies on a
higher-level protocol to take care of all these problems.
● Packets in the IPv4 layer are called datagrams.
A datagram is a variable-length packet consisting of two parts: header and data.
● The header is 20 to 60 bytes in length and contains information essential to routing and
delivery.
i) Version (VER)(4 bits): This 4-bit field defines the version of the IPv4 protocol. Currently the
version is 4. However, version 6 (or IPng) may totally replace version 4 in the future.
ii) Header length (HLEN) (4 bits):This 4-bit field defines the total length of the datagram
header in 4-byte words. This field is needed because the length of the header is variable (between
20 and 60 bytes). When there are no options, the header length is 20 bytes, and the value of this
field is 5 (5 x 4 = 20). When the option field is at its maximum size, the value of this field is 15
(15 x 4 = 60).
iii) Services(8 bits):IETF has changed the interpretation and name of this 8-bit field. This field,
previously called service type, is now called differentiated services.It specifies the tradeoff
between low delay, high reliability & throughput.It also describes queuing priorities, discard
probabilities.
iv) Total length(16 bits): This is a 16-bit field that defines the total length (header plus data)of
the IPv4 datagram in bytes.
● Length of data =total length - header length
● Since the field length is 16 bits, the total length of the IPv4 datagram is limited to 65,535
(216 - 1) bytes, of which 20 to 60 bytes are the header and the rest is data from the upper
layer.
v) Identification(16 bits): This field is used in fragmentation.It is used to indicate which
fragment belongs to which datagram.It is needed to allow the destination host to determine
which datagram a newly arrived fragment belongs to.All fragments of a datagram contain the
same identification value.
vi) Flags(3 bits): This field is used in fragmentation
● The first bit is reserved
● D(Do not fragment bit): If it is set then routers should not fragment the datagram. If not
set then fragment if necessary.
● M(More fragment bit): If it is set then it means the datagram is not the last fragment but if
it is not set it shows that this is the last fragment.
vii) Fragmentation offset(13 Bits):This 13-bit field shows the relative position of this fragment
with respect to the whole datagram. It is the offset of the data in the original datagram
measured in units of 8 bytes.
viii) Time to live(TTL)(8 bits): A datagram has a limited lifetime in its travel through an
internet.This field is used mostly to control the maximum number of hops (routers) visited
by the datagram. When a source host sends the datagram, it stores a number in this field.
Each router that processes the datagram decrements this number by 1. If this value, after
being decremented, is zero, the router discards the datagram.This field is needed because
routing tables in the Internet can become corrupted.A datagram may travel between two or
more routers for a long time without ever getting delivered to the destination host. This field
limits the lifetime of a datagram.
ix) Protocol(8 bits): This 8-bit field defines the higher-level protocol that uses the services of
the IPv4 layer. An IPv4 datagram can encapsulate data from several higher-level protocols
such as TCP, UDP, ICMP, and IGMP. This field specifies the final destination protocol to
which the IPv4 datagram is delivered.
x) Checksum(16 bits):It verifies the header only.It is useful for detecting errors.The value of
the checksum field is set to 0. Then the entire header is divided into 16-bit sections and added
together. The result (sum) is complemented and inserted into the checksum field.The
checksum in the IPv4 packet covers only the header, not the data.
xi) Source address(32 bits): This 32-bit field defines the IPv4 address of the source. This field
must remain unchanged during the time the IPv4 datagram travels from the source host tothe
destination host.
xii) Destination address(32 bits): This 32-bit field defines the IPv4 address of the
destination.This field must remain unchanged during the time the IPv4 datagram travels from
the source host to the destination host.
xiii) Options(0 to 40 bytes):The header of the IPv4 datagram is made of two parts: a fixed part
and a variable part.The fixed part is 20 bytes long and the variable part comprises the
options that can be a maximum of 40 bytes.Options, as the name implies, are not required
for a datagram. They can be used for network testing and debugging.
5) Explain IPv4 and IPv6 protocols in detail.(or) Give some important differences between
IPv4 and IPv6. (or) What are the advantages of IPv6 over IPv4? (V.IMP 3 or 5 M)
Ans: IPv4 is an unreliable and connectionlessdatagramprotocol-a best-effort delivery service.
The term best-effort means that IPv4 provides no error control or flow control (except for error
detection on the header).
● IPv4 assumes the unreliability of the underlying layers and does its best to get a
transmission through to its destination, but with no guarantees.
● If reliability is important, IPv4 must be paired with a reliable protocol such as TCP.
● IPv4 is also a connectionless protocol for a packet-switching network that uses the
datagram approach. This means that each datagram is handled independently, and each
datagram can follow a different route to the destination. This implies that datagrams sent
by the same source to the same destination could arrive out of order.
● Also, some could be lost or corrupted during transmission. Again, IPv4 relies on a
higher-level protocol to take care of all these problems.
Packets in the IPv4 layer are called datagrams.
● IPv6 (Internetworking Protocol, version 6), also known as IPng (Internetworking
Protocol, next generation). In IPv6, the Internet protocol was extensively modified to
accommodate the unforeseen growth of the Internet. The format and the length of the IP
address were changed along with the packet format. Related protocols, such as ICMP,
were also modified. Other protocols in the network layer, such as ARP, RARP, and
IGMP, were either deleted or included in the ICMPv6 protocol
IPv6 Advantages over IPv4:
● Larger address space:An IPv6 address is 128 bits long. Compared with the 32-bit
address of IPv4, this is a huge (296) increase in the address space.
● Better header format: IPv6 uses a new header format in which options are separated
from the base header and inserted, when needed, between the base header and the upper-
layer data. This simplifies and speeds up the routing process because most of the options
do not need to be checked by routers.
● New options:IPv6 has new options to allow for additional functionalities.
● Allowance for extension: IPv6 is designed to allow the extension of the protocol if
required by new technologies or applications.
● Support for resource allocation: In IPv6, the type-of-service field has been removed,
but a mechanism (called flowlabel) has been added to enable the source to request special
handling of the packet. This mechanism can be used to support traffic such as real-time
audio and video.
● Support for more security: The encryption and authentication options in IPv6 provide
confidentiality and integrity of the packet.
IPv6 Header(Packet Format): Each packet is composed of a mandatory base header
followed by the payload.
● The payload consists of two parts: optional extension headers and data from an upper
layer.
● The base header occupies 40 bytes, whereas the extension headers and data from the
upper layer contain up to 65,535 bytes of information.
Base Header: It has eight fields.
i) Version(4 Bits):This 4-bit field defines the version number of the IP. For IPv6, the value is
6.
ii) Priority: The 8-bit priority field defines the priority of the packet with respect to traffic
congestion.
iii) Flow label:The flow label is a 20-bit field that is designed to provide special handling for
a particular flow of data.
iv) Payload length: The 2-byte payload length field defines the length of the IP datagram
excluding the base header.
v) Next header: The next header is an 8-bit field defining the header that follows the base
header in the datagram. The next header is either one of the optional extension headers used
by IP or the header of an encapsulated packet such as UDP or TCP.
vi) Hop limit: This 8-bit hop limit field serves the same purpose as the TTL field in IPv4.
vii) Source address: The source address field is a 16-byte (128-bit) Internet address that
identifies the original source of the datagram.
viii) Destination address: The destination address field is a 16-byte (128-bit) Internet
address that usually identifies the final destination of the datagram. If source routing is used,
this field contains the address of the next router.
IPv4 IPv6
It uses a 32 bit address. So 232 ways to It uses 128-bit address. So2128 possible
represent the address ways.
6. Explain OSPF and BGP in detail. (or) Discuss the details of one exterior gateway
routing protocol. ( V.V Imp, 5 or 10 M each)
Ans: OSPF—The Interior Gateway Routing Protocol: The Open Shortest Path First or OSPF
protocol is an intradomain routing protocol based on link state routing. Its domain is also an
autonomous system.Internet is made up of a large number of autonomous systems. Each AS is
operated by a different organization and can use its own routing algorithm inside. A routing
algorithm within an AS is called an interior gateway protocol; an algorithm for routing between
ASes is called an exterior gateway protocol.
OSPF (Open Shortest Path First), became a standard in 1990. Most router vendors now support
it, and it has become the main interior gateway protocol.
OSPF supports three kinds of connections and networks:
1. Point-to-point lines between exactly two routers.
2. Multiaccess networks with broadcasting (e.g., most LANs).
3. Multiaccess networks without broadcasting (e.g., most packet-switched WANs).
A multiaccess network is one that can have multiple routers on it, each of which can directly
communicate with all the others. All LANs and WANs have this property.
OSPF operates by abstracting the collection of actual networks, routers, and lines into a directed
graph in which each arc is assigned a cost (distance, delay, etc.). OSPF fundamentally represent
the actual network as a graph and then compute the shortest path from every router to every other
router.
Many of the ASes in the Internet are themselves large and nontrivial to manage. OSPF allows
them to be divided into numbered areas, where an area is a network or a set of contiguous
networks. Areas do not overlap but need not be exhaustive, that is, some routers may belong to
no area. An area is a generalization of a subnet. Outside an area, its topology and details are not
visible.
Every AS has a backbone area, called area 0. All areas are connected to the backbone, possibly
by tunnels, so it is possible to go from any area in the AS to any other area in the AS via the
backbone. A tunnel is represented in the graph as an arc and has a cost. Each router that is
connected to two or more areas is part of the backbone. As with other areas, the topology of the
backbone is not visible outside the backbone.
During normal operation, three kinds of routes may be needed: intra-area, interarea, and inter-
AS. Intra-area routes are the easiest, since the source router already knows the shortest path to
the destination router. Interarea routing always proceeds in three steps: go from the source to the
backbone; go across the backbone to the destination area; go to the destination. This algorithm
forces a star configuration on OSPF with the backbone being the hub and the other areas being
spokes. Packets are routed from source to destination ''as is.'' They are not encapsulated or
tunneled, unless going to an area whose only connection to the backbone is a tunnel.
The relation between ASes, backbones, and areas in OSPF.
After all the paths come in from the neighbors, F examines them to see which is the best. It
quickly discards the paths from I and E, since these paths pass through F itself. The choice is
then between using B and G. Every BGP router contains a module that examines routes to a
given destination and scores them, returning a number for the ''distance'' to that destination for
each route. Any route violating a policy constraint automatically gets a score of infinity. The
router then adopts the route with the shortest distance. The scoring function is not part of the
BGP protocol and can be any function the system managers want.
BGP easily solves the count-to-infinity problem that plagues other distance vector routing
algorithms. For example, suppose G crashes or the line FG goes down. F then receives routes
from its three remaining neighbors. These routes are BCD, IFGCD, and EFGCD. It can
immediately see that the two latter routes are pointless, since they pass through F itself, so it
chooses FBCD as its new route.
Types of Autonomous Systems: The Internet is divided into hierarchical domains called
autonomous systems. For example, a large corporation that manages its own network and has full
control over it is an autonomous system. A local ISP that provides services to local customers is
an autonomous system. We can divide autonomous systems into three categories: stub,
multihomed, and transit.
Stub AS: A stub AS has only one connection to another AS. The interdomain data traffic in
a stub AS can be either created or terminated in the AS. The hosts in the AS can send data
traffic to other ASs. The hosts in the AS can receive data coming from hosts in other ASs.
Data traffic, however, cannot pass through a stub AS. A stub AS is either a source or a sink.
A good example of a stub AS is a small corporation or a small local ISP.
Multihomed AS: A multihomed AS has more than one connection to other ASs, but it is still
only a source or sink for data traffic. It can receive data traffic from more than one AS. It can
send data traffic to more than one AS, but there is no transient traffic. It does not allow data
coming from one AS and going to another AS to pass through. A good example of a
multihomed AS is a large corporation that is connected to more than one regional or national
AS that does not allow transient traffic.
Transit AS: A transit AS is a multihomed AS that also allows transient traffic. Good
examples of transit ASs are national and international ISPs (Internet backbones).
8. Discuss about ARP protocol. (or) Explain internet control protocols (ICMP, ARP,
RARP, BOOTPand DHCP). (or) (V.V.IMP 3 or 5m each)
Ans:IP was designed as a best-effort delivery protocol, but it lacks some features such as
flow control and error control.
● To make IP more responsive to some requirements in today's intemetworking, we need
the help of other protocols. These protocols are called as Internet Control Protocols.
● Important Internet Control Protocols are
● ARP (Address Resolution Protocol)
● RARP (Reverse Address Resolution Protocol)
● BOOTP
● DHCP (Dynamic Host Configuration Protocol)
● ICMP (Internet Control Message Protocol)
ARP (Address Resolution Protocol): It is used for mapping an IP address to its MAC
address.Whenever a host has an IP datagram to send to another host or router, it has the
logical (IP) address of the receiver. The logical (IP) address is obtained from the DNS. But
the IP datagram must be encapsulated in a frame to be able to pass through the physical
network. This means that the sender needs the physical address of the receiver. The host
or the router sends an ARP query packet. The packet includes the physical and IP addresses
of the sender and the IP address of the receiver. Because the sender does not know the
physical address of the receiver, the query is broadcast over the network.Every host or router
on the network receives and processes the ARP query packet, but only the intended recipient
recognizes its IP address and sends back an ARP response packet. The response packet
contains the recipient's IP and physical addresses. The packet is unicast directly to the
inquirer by using the physical address received in the query packet.
ARP Packet Format: The fields are as follows:
● Hardware type: This is a 16-bit field defining the type of the network on which ARP is
running. Each LAN has been assigned an integer based on its type. For example, Ethernet is
given type 1. ARP can be used on any physical network.
● Protocol type: This is a 16-bit field defining the protocol. For example, the value of this
field for the IPv4 protocol is 080016, ARP can be used with any higher-level protocol.
● Hardware length: This is an 8-bit field defining the length of the physical address in bytes.
For example, for Ethernet the value is 6.
● Protocol length: This is an 8-bit field defining the length of the logical address in bytes. For
example, for the IPv4 protocol the value is 4.
● Operation: This is a 16-bit field defining the type of packet. Two packet types are defined:
ARP request (1) and ARP reply (2).
● Sender hardware address: This is a variable-length field defining the physical address of
the sender. For example, for Ethernet this field is 6 bytes long.
● Sender protocol address: This is a variable-length field defining the logical (for example,
IP) address of the sender. For the IP protocol, this field is 4 bytes long.
● Target hardware address: This is a variable-length field defining the physical address of
the target. For example, for Ethernet this field is 6 bytes long. For an ARP request message,
this field is all 0s because the sender does not know the physical address of the target.
● Target protocol address:. This is a variable-length field defining the logical (for example,
IP) address of the target. For the IPv4 protocol, this field is 4 bytes long.
Operation:
1. The sender knows the IP address of the target.
2. IP asks ARP to create an ARP request message, filling in the sender physical address, the
sender IP address, and the target IP address. The target physical address field is filled with 0s.
3. The message is passed to the data link layer where it is encapsulated in a frame by using the
physical address of the sender as the source address and the physical broadcast address as the
destination address.
4. Every host or router receives the frame. Because the frame contains a broadcast destination
address, all stations remove the message and pass it to ARP. All machines except the one
targeted drop the packet. The target machine recognizes its IP address.
5. The target machine replies with an ARP reply message that contains its physical address. The
message is unicast.
6. The sender receives the reply message. It now knows the physical address of the target
machine.
7. The IP datagram, which carries data for the target machine, is now encapsulated in a frame
and is unicast to the destination.
RARP (Reverse Address Resolution Protocol) : It is used to map MAC address to an IP
address.RARP is a protocol by which a physical machine in a local area network can request to
learn its IP address from a gateway server's Address Resolution Protocol table or cache. This is
needed since the machine may not have permanently attached disk where it can store its IP
address permanently. A network administrator creates a table in a local area network's gateway
router that maps the physical machine (or Medium Access Control - MAC) addresses to
corresponding Internet Protocol addresses. When a new machine is set up, its RARP client
program requests from the RARP server on the router to be sent its IP address. Assuming that an
entry has been set up in the router table, the RARP server will return the IP address to the
machine which can store it for future use.
BOOTP:The Bootstrap Protocol (BOOTP) is a client/server protocol designed to
providephysical address to logical address mapping. BOOTP is an application layer protocol.The
administrator may put the client and the server on the same network or on different networks.
BOOTP messages are encapsulated in a UDP packet, and the UDP packet itself is encapsulated
in an IP packet. One of the advantages of BOOTP over RARP is that the client and server are
application-layer processes.
As in other application-layer processes, a client can be in one network and the server in another,
separated by several other networks.
However, there is one problem that must be solved. The BOOTP request is broadcast because the
client does not know the IP address of the server.
A broadcast IP datagram cannot pass through any router. To solve the problem, there is a need
for an intermediary. One of the hosts (or a router that can be configured to operate at the
application layer) can be used as a relay. The host in this case is called a relay agent.
The relay agent knows the unicast address of a BOOTP server. When it receives this type of
packet, it encapsulates the message in a unicast datagram and sends the request to the BOOTP
server.
The packet, carrying a unicast destination address, is routed by any router and reaches the
BOOTP server. The BOOTP server knows the message comes from a relay agent because one of
the fields in the request message defines the IP address of the relay agent. The relay agent, after
receiving the reply, sends it to the BOOTP client.
DHCP:DHCP (Dynamic Host Configuration Protocol). DHCP allows both manual IP address
assignment and automatic assignment. It is described in RFCs 2131 and 2132
Like RARP and BOOTP, DHCP is based on the idea of a special server that assigns IP addresses
to hosts asking for one. This server need not be on the same LAN as the requesting host. Since
the DHCP server may not be reachable by broadcasting, a DHCP relay agent is needed on each
LAN.
To find its IP address, a newly-booted machine broadcasts a DHCP DISCOVER packet. The
DHCP relay agent on its LAN intercepts all DHCP broadcasts. When it finds a DHCP
DISCOVER packet, it sends the packet as a unicast packet to the DHCP server, possibly on a
distant network. The only piece of information the relay agent needs is the IP address of the
DHCP server.
An issue that arises with automatic assignment of IP addresses from a pool is how long an IP
address should be allocated. If a host leaves the network and does not return its IP address to the
DHCP server, that address will be permanently lost. After a period of time, many addresses may
be lost. To prevent that from happening, IP address assignment may be for a fixed period of time,
a technique called leasing. Just before the lease expires, the host must ask the DHCP for a
renewal. If it fails to make a request or the request is denied, the host may no longer use the IP
address it was given earlier.
9. What is Classful addressing? (or) What are the various IP address formats? (or) Draw
the formats of different classes of IP addresses. (or) Describe IPv4 Classful Addressing.
(V.IMP) 5 M
Ans: IPv4 addressing, at its inception, used the concept of classes. This architecture is called
classful addressing.
● In classful addressing, the address space is divided into five classes: A, B, C, D, and E.
Each class occupies some part of the address space.
● One problem with classful addressing is that each class is divided into a fixed number of
blocks with each block having a fixed size
● Previously, when an organization requested a block of addresses, it was granted one in
class A, B, or C.
● Class A addresses were designed for large organizations with a large number of attached
hosts or routers.
● Class B addresses were designed for midsize organizations with tens of thousands of
attached hosts or routers.
● Class C addresses were designed for small organizations with a small number of attached
hosts or routers.
● Flaws in Classful Addressing:
● A block in class A address is too large for almost any organization. This means most of
the addresses in class A were wasted and were not used.
● A block in class B is also very large, probably too large for many of the organizations
that received a class B block.
● A block in class C is probably too small for many organizations.
● Class D addresses were designed for multicasting. Each address in this class is used to
define one group of hosts on the Internet. The Internet authorities wrongly predicted a
need for 268,435,456 groups. This never happened and many addresses were wasted here
too.
● And lastly, the class E addresses were reserved for future use; only a few were used,
resulting in another waste of addresses.
● So, In classful addressing, a large part of the available addresses were wasted.
● Netid and Hostid
● In classful addressing, an IP address in class A, B, or C is divided into netid and hostid.
● These parts are of varying lengths, depending on the class of the address.
● In class A, one byte defines the netid and three bytes define the hostid.
● In class B, two bytes define the netid and two bytes define the hostid.
● In class C, three bytes define the netid and one byte defines the hostid.
12. State the purpose of Tunneling. (or) What is tunneling? (V.V.IMP 3/5 M)
Ans: Tunneling is a mechanism used to send a packet between two similar networks
connected by a different intermediary network. No conversion of packet is required. The
packet is encapsulated in the payload field of the intermediary network.
● Tunneling is a strategy used when two computers using IPv6 want to communicate with
each other and the packet must pass through a region that uses IPv4.
● To pass through this region, the packet must have an IPv4 address. So the IPv6 packet is
encapsulated in an IPv4 packet when it enters the region, and it leaves its capsule when it
exits the region. It seems as if the IPv6 packet goes through a tunnel at one end and
emerges at the other end. To make it clear that the IPv4 packet is carrying an IPv6 packet
as data, the protocol value is set to 41.
● Tunneling is often used in virtual private networks (VPNs).
13. What is autonomous system?
Ans: An autonomous system (AS) is a group of networks and routers under the authority of a
single administration.
Today, an internet can be so large that one routing protocol cannot handle the task of
updating the routing tables of all routers. For this reason, an internet is divided into autonomous
systems.
● Routing inside an autonomous system is referred to as intradomain routing.
● Routing between autonomous systems is referred to as interdomain routing.
● Each autonomous system can choose one or more intradomain routing protocols to
handle routing inside the autonomous system. Ex: OSPF
● However, only one interdomain routing protocol handles routing between autonomous
systems. Ex: BGP
14. Explain the Leaky Bucket mechanism used for traffic shaping and how it differs from
token bucket. (or) Token bucket algorithm(V.IMP 5m)(Anyone)
Ans: Congestion occurs when the number of packets being transmitted through the network
approaches the packet handling capacity of the network
Congestion control aims to keep number of packets below the level at which performance starts
to degrade dramatically.
Traffic Shaping: Traffic shaping is a mechanism to control the amount and the rate of the traffic
sent to the network. Two techniques can shape traffic: leaky bucket and token bucket.
Leaky Bucket Algorithm
● A leaky bucket algorithm shapes bursty traffic into fixed rate traffic by averaging the data
rate.
● If a bucket has a small hole at the bottom, the water leaks from the bucket at a constant
rate as long as there is water in the bucket. The rate at which the water leaks does not
depend on the rate at which the water is input to the bucket unless the bucket is empty.
The input rate can vary, but the output rate remains constant.
● Similarly, in networking, a technique called leaky bucket can smooth out bursty traffic.
Bursty chunks are stored in the bucket and sent out at an average rate. It may drop the
packets if the bucket is full.
• Also, when the bucket is full, any additional water that enters into the bucket spills over the
sides and is lost.
● The same concept that the network has committed a bandwidth of 3 Mbps for a host. The use
of the leaky bucket shapes the input traffic to make it conform to this commitment.
● The host sends a burst of data at a rate of 12 Mbps for 2s, for a total of 24 Mbits of data. The
host is silent for 5 s and then sends data at a rate of 2 Mbps for 3 s, for a total of 6 Mbits of
data. In all, the host has sent 30 Mbits of data in l0s. The leaky bucket smooths the traffic by
sending out data at a rate of 3 Mbps during the same 10’s.
● Without the leaky bucket, the beginning burst may have hurt the network by consuming more
bandwidth than is set aside for this host. We can also see that the leaky bucket may prevent
congestion.
● Leaky Bucket Algorithm Implementation: A FIFO queue holds the packets. If the traffic
consists of fixed-size packets (e.g., cells in ATM networks), the process removes a fixed
number of packets from the queue at each tick of the clock. If the traffic consists of variable-
length packets, the fixed output rate must be based on the number of bytes or bits.
Algorithm for variable-length packets:
1. Initialize a counter to n at the tick of the clock.
2. If n is greater than the size of the packet, send the packet and decrement the counter by the
packet size. Repeat this step until n is smaller than the packet size.
3. Reset the counter and go to step 1.
15. Explain count to infinity problem. (or) Explain two-node instability problem.3m/5m
Ans: It is a problem of Distance vector routing algorithm. In this good news spreads fast and
bad news spreads very slowly.
When router X tells Y that it has a path somewhere, Y has no way of knowing that it itself is on
the path.
The diagram below shows, bad news propagates slowly.
For example the link from A to B is broken; B discovers that A is unreachable but that C has a
metric of 2 to A, possibly through B itself or perhaps through an alternate route.
B assumes that A can now be reached in 3 hops through C. B has no way of knowing the path
through C to A includes B since it only has information from directly connected routers.
On the next exchange, C discovers that A is reachable through B or D in 3 hops so updates table
to A in 4 hops.
The information that A is unreachable propagates slowly, converging toward infinity.
16. Explain Hierarchical routing algorithm. 5m
Ans: It can be used to solve the problem of gigantic routing tables.
In both LS and DV algorithms, every router has to save some information about other
routers. When the network size grows, the number of routers in the network increases.
Consequently, the size of routing tables increases, as well, and routers can't handle network
traffic as efficiently. Hierarchical routing can be used to overcome this problem. We use
DV algorithms to find best routes between nodes. In the situation depicted below, every node
of the network has to save a routing table with 17 records. Here is a typical graph and routing
table for A:
In hierarchical routing, routers are classified in groups known as regions. Each router has only
the information about the routers in its own region and has no information about routers in other
regions. So routers just save one record in their table for every other region. In this example, we
have classified our network into five regions.
If A wants to send packets to any router in region 2 (D, E, F or G), it sends them to B, and so on.
As you can see, in this type of routing, the tables can be summarized, so network efficiency
improves. The above example shows two-level hierarchical routing. We can also use three- or
four-level hierarchical routing.
In three-level hierarchical routing, the network is classified into a number of clusters. Each
cluster is made up of a number of regions, and each region contains a number or routers.
Hierarchical routing is widely used in Internet routing and makes use of several routing
protocols.
17. What are the services of network layer 3m
Ans: The services which are offered by the network layer protocol are:
1. Packetizing: The process of encapsulating the data received from upper layers of the
network(also called as payload) in a network layer packet at the source and decapsulating
the payload from the network layer packet at the destination is known as packetizing.
2. Routing and Forwarding: These are two other services offered by the network layer. In
a network, there are a number of routes available from the source to the destination. The
network layer specifies some strategies which find out the best possible route. This
process is referred to as routing. Forwarding is simply defined as the action applied by
each router when a packet arrives at one of its interfaces. When a router receives a packet
from one of its attached networks, it needs to forward the packet to another attached
network (unicast routing) or to some attached networks(in case of multicast routing).
3. Fragmentation is done by the network layer when the size of datagram is greater than
maximum size of data that can be held by a frame i.e., its Maximum Transmission Unit
(MTU). The network layer divides the datagram received from transport layer into fragments
so that data flow is not disrupted.
18. Why is fragmentation of packets done in computer networks? What are its
disadvantages?
Ans: IP fragmentation is an Internet Protocol (IP) process that breaks packets into smaller
pieces (fragments), so that the resulting pieces can pass through a link with a smaller
maximum transmission unit (MTU) than the original packet size.
IP Fragmentation is done by the network layer when the size of datagram is greater than
maximum size of data that can be held by a frame i.e., its Maximum Transmission Unit
(MTU). The network layer divides the datagram received from transport layer into fragments
so that data flow is not disrupted.
Transparent Fragmentation:
● When an oversized packet arrives at a gateway, the gateway breaks it up into fragments.
● Each fragment is addressed to the same exit gateway, where the pieces are recombined.
● In this way passage through the small-packet network has been made transparent.
● Subsequent networks are not even aware that fragmentation has occurred.
Non Transparent Fragmentation:
● Once a packet has been fragmented, each fragment is treated as though it were an original
packet.
● All fragments are passed through the exit gateways (need not be same)
● Recombination occurs only at the destination host.
Disadvantages of transparent fragmentation are:
● Exit fragment that recombines fragments in a network must know when it has received all
fragments.
● Some fragments chooses different gateways for exit that results in poor performance.
● It adds considerable overhead in repeatedly fragmenting and reassembling large packet.
Disadvantages of Non-Transparent Fragmentation are:
● Every host must have the capability of reassembling fragments.
● When a packet is fragmented, fragments should be numbered in such a way that the original
data stream can be reconstructed.
● Total overhead increases due to fragmentation as each fragment must have its own header.
19. What is network address translation (NAT)?
Ans: One quick solution to shortage of address problem is called network address translation.
● NAT enables a user to have a large set of addresses internally and one address, or a small
set of addresses, externally. The traffic inside can use the large set; the traffic outside, the
small set.
● To separate the addresses used inside the home or business and the ones used for the
Internet, the Internet authorities have reserved three sets of addresses as private
addresses.
● Any organization can use an address out of this set without permission from the Internet
authorities. Everyone knows that these reserved addresses are for private networks.
● They are unique inside the organization, but they are not unique globally. No router will
forward a packet that has one of these addresses as the destination address.
● The site must have only one single connection to the global Internet through a router that
runs the NAT software.
● The router that connects the network to the global address uses one private address and
one global address. The private network is transparent to the rest of the Internet; the rest
of the Internet sees only the NAT router with the address 200.24.5.8.
● Address Translation: All the outgoing packets go through the NAT router, which
replaces the source address in the packet with the global NAT address.
● All incoming packets also pass through the NAT router, which replaces the destination
address in the packet (the NAT router global address) with the appropriate private
address.
20. Define IP protocol. (or) list out the advantages/disadvantages of IP. (or) List out the
functions of IP.3m
Ans: It is the host to host network layer delivery protocol designed for the internet. It is a
connectionless datagram protocol with no guarantee of reliability. It is unreliable as it does
not provide error control or flow control.
Functions of IP Protocol:
i) Addressing: IP packet headers contain addresses that identify the sending computer and the
receiving computer. Routers use this information to guide each packet across communication
networks and connect the sending and receiving computers.
ii) Reassembly: Messages between computers are broken into packets. Since most messages are
too big to fit in one packet, and since packets aren't sent in any organized order. So they must be
reassembled as they arrive at the recipient. IP dictates how packets are reassembled into usable
messages.
iii) Timeouts: Each IP packet contains a Time to Live (TTL) Field. Every time when router
handles a packet, TTL field is decremented. If TTL reaches zero then packet is discarded. This
prevents the packet from running in circles forever and flooding a network.
iv) Fragmentation: IP Packets may be split, or fragmented into smaller packet. This permits a
large packet to travel across a network which can only handle smaller packets. IP fragments
packets transparently.
v) Type of Service: IP supports traffic prioritization by allowing packets to be labeled with an
abstract type of service.
vi) Options: IP includes optional features such as allowing the sending computer to decide the
path. To trace the path they take. To include added security in the packets.
21. Explain in short about subnet mask. 3m/5m
Ans: Subnet Mask:A subnet mask is a 32 bits address used to distinguish between a network
address and a host address in IP address. A subnet mask identifies which part of an IP address is
the network address and the host address. They are not shown inside the data packets traversing
the Internet. They carry the destination IP address, which a router will match with a subnet.
Two types of subnet masks are:
The default Subnet Mask is the number of bits which is reserved by the address class.
Using this default mask will accommodate a single network subnet in the relative class.
A Custom Subnet Mask can be defined by an administrator to accommodate many
Network
Using a Subnet Mask:
The subnet mask is used by the router to cover up the network address. It shows which bits are
used to identify the subnet.
Methods of Subnet Masking
We can subnet the masking process in two ways: Straight or Short-cut.
1) Straight: Uses the binary notation method for both the address and the mask and then apply
the AND operation to get the block address.
2) Short-Cut Method
In case the byte in the mask is 255, you need to copy the byte in the destination address.
When the byte in the mask is 0, then you need to replace the byte in the address with 0.
When the byte in the mask is neither 255 nor 0, then you should write the mask and the
address in binary and use the AND operation.
In case if the extracted network address matches the local network ID, and the destination
is located on the local Network. However, if they do not match, the message must be
routed outside the local Network.
Class Default subnet mask No. of networks No. of host per network
A 255.0.0.0 256 16,777,214
B 255.255.0.0 65,536 65,534
C 255.255.255.0 16,77,216 126
BOOTP stands for Bootstrap DHCP stands for Dynamic host configuration
1.
Protocol. protocol.
BOOTP can have errors due to In DHCP errors do not occur mostly due to auto-
6.
manual-configuration. configuration.
ARP stands for Address Resolution RARP stands for Reverse Address
1.
Protocol. Resolution Protocol.
In ARP, ARP table uses ARP reply for In RARP, RARP table uses RARP reply
6.
its updation. for configuration of IP addresses .
25. Identify the IPv4 class, netid and the hostid of the following IP addresses. a) 132 .56.8.6
b) 208.34.54.12 (V.IMP).2m
Ans: In Class A 24 bit networkid and 8 bit hostid. In Class B 16 bit networkid and 16
bit hostid. In Class C 8 bit networkid and 24bit hostid is used generally.