Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Computer Networks

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 26

CN UT 2

1)Write a short note on ARP.

Ans: ARP (Address Resolution Protocol) is an important protocol that plays an important role in the
networking world.

When working with your network systems, this protocol helps to identify specified network devices
and find their addresses.

Its main purpose is to duly transport data packets over the network, allowing them to move between
devices connected to your heritage network.

How ARP Works:

1. When a device wants to communicate with another device on a network, it sends an ARP
request with the IP address of the destination device.

2. The ARP request is broadcast to all devices on the network.

3. The device with the matching IP address responds with its MAC address.

4. The sender device stores the MAC address in its ARP cache for future reference.

ARP ensures accurate delivery of data packets across a network by providing


the necessary MAC address information.
It's a critical protocol for network communication and is widely used in
Ethernet, Wi-Fi, and other network technologies.
Key aspects include:
 ARP Request: Broadcast to all devices in a network to find the MAC address
associated with an IP.
 ARP Reply: Sent by the device with the matching IP, containing its MAC
address.
 ARP Cache: Stores mappings of IP addresses to MAC addresses to improve
efficiency and reduce the need for repeated ARP requests.

2)/3) What is congestion control? Explain open loop and closed loop congestion control
policy.
Ans:
 Congestion control is a crucial concept in computer networks.
It refers to the methods used to prevent network overload and ensure smooth data flow.
When too much data is sent through the network at once, it can cause delays and data
loss.
Congestion control techniques help manage the traffic, so all users can enjoy a stable
and efficient network connection.
These techniques are essential for maintaining the performance and reliability of modern
networks.
Protocols Using Congestion Control:
1. TCP (Transmission Control Protocol)
2. ATM (Asynchronous Transfer Mode)
3. MPLS (Multiprotocol Label Switching)
4. DCCP (Datagram Congestion Control Protocol)
Effective congestion control:
1. Ensures reliable data transfer
2. Prevents network downtime
3. Optimizes network performance
4. Enhances user experience
 Open loop congestion control policy:
Open loop congestion control policies are applied to prevent congestion before it
happens. The congestion control is handled either by the source or the destination.
Policies adopted by open loop congestion control –

1. Retransmission Policy : It is the policy in which retransmission of the packets


are taken care of. If the sender feels that a sent packet is lost or corrupted, the
packet needs to be retransmitted. This transmission may increase the congestion
in the network
2. Window Policy :
The type of window at the sender’s side may also affect the congestion. Several
packets in the Go-back-n window are re-sent, although some packets may be
received successfully at the receiver side. This duplication may increase the
congestion in the network and make it worse.
3. Discarding Policy :
A good discarding policy adopted by the routers is that the routers may prevent
congestion and at the same time partially discard the corrupted or less sensitive
packages and also be able to maintain the quality of a message
4. Acknowledgment Policy :
Since acknowledgements are also the part of the load in the network, the
acknowledgment policy imposed by the receiver may also affect congestion.
Several approaches can be used to prevent congestion related to
acknowledgment.
5. Admission Policy :
In admission policy a mechanism should be used to prevent
congestion. Switches in a flow should first check the
resource requirement of a network flow before transmitting
it further. If there is a chance of a congestion or there is a
congestion in the network, router should deny establishing
a virtual network connection to prevent further congestion.
 Close loop congestion control policy:
Closed loop congestion control techniques are used to treat or
alleviate congestion after it happens. Several techniques are
used by different protocols; some of them are:

1. Backpressure :
Backpressure is a technique in which a congested node stops
receiving packets from upstream node. This may cause the
upstream node or nodes to become congested and reject
receiving data from above nodes. Backpressure is a node-to-
node congestion control technique that propagate in the
opposite direction of data flow. The backpressure technique can
be applied only to virtual circuit where each node has
information of its above upstream node.

In above diagram the 3rd node is congested and stops receiving


packets as a result 2nd node may be get congested due to
slowing down of the output data flow. Similarly 1st node may get
congested and inform the source to slow down.

2. Choke Packet Technique :


Choke packet technique is applicable to both virtual networks as
well as datagram subnets. A choke packet is a packet sent by a
node to the source to inform it of congestion. Each router
monitors its resources and the utilization at each of its output
lines. Whenever the resource utilization exceeds the threshold
value which is set by the administrator, the router directly sends
a choke packet to the source giving it a feedback to reduce the
traffic. The intermediate nodes through which the packets has
traveled are not warned about congestion.
3. Implicit Signaling :
In implicit signaling, there is no communication between the
congested nodes and the source. The source guesses that there
is congestion in a network. For example when sender sends
several packets and there is no acknowledgment for a while, one
assumption is that there is a congestion.

4. Explicit Signaling :
In explicit signaling, if a node experiences congestion it can
explicitly sends a packet to the source or destination to inform
about congestion. The difference between choke packet and
explicit signaling is that the signal is included in the packets that
carry data rather than creating a different packet as in case of
choke packet technique.
Explicit signaling can occur in either forward or backward
direction.
 Forward Signaling : In forward signaling, a signal is sent
in the direction of the congestion. The destination is warned
about congestion. The receiver in this case adopt policies to
prevent further congestion.
 Backward Signaling : In backward signaling, a signal is
sent in the opposite direction of the congestion. The source
is warned about congestion and it needs to slow down.
4)Explain IPV4 header format in detail.
Ans:

The IPv4 datagram header is a critical component of the Internet


Protocol Version 4, allowing data to be routed and delivered
across networks. The IPv4 header, which includes structured
data such as version, header length, type of service, and
checksum, facilitates efficient and reliable communication
between devices. While optional fields provide flexibility, its fixed
and variable-length components adapt to a wide range of
networking requirements. Understanding the IPv4 datagram
header is critical for network engineers and administrators to
effectively manage and optimise data transfer in IPv4-based
networks
IPv4 Datagram Header
 VERSION: Version of the IP protocol (4 bits), which is 4 for
IPv4
 HLEN: IP header length (4 bits), which is the number of 32
bit words in the header. The minimum value for this field is
5 and the maximum is 15.
 Type of service: Low Delay, High Throughput, Reliability
(8 bits)
 Total Length: Length of header + Data (16 bits), which
has a minimum value 20 bytes and the maximum is 65,535
bytes.
 Identification: Unique Packet Id for identifying the group
of fragments of a single IP datagram (16 bits)
 Flags: 3 flags of 1 bit each : reserved bit (must be zero), do
not fragment flag, more fragments flag (same order)
 Fragment Offset: Represents the number of Data Bytes
ahead of the particular fragment in the particular
Datagram. Specified in terms of number of 8 bytes, which
has the maximum value of 65,528 bytes.

 Time to live: Datagram’s lifetime (8 bits), It prevents the


datagram to loop through the network by restricting the
number of Hops taken by a Packet before delivering to the
Destination.
 Protocol: Name of the protocol to which the data is to be
passed (8 bits)
 Header Checksum: 16 bits header checksum for checking
errors in the datagram header
 Source IP address: 32 bits IP address of the sender
 Destination IP address: 32 bits IP address of the
receiver
 Option: Optional information such as source route, record
route. Used by the Network administrator to check whether
a path is working or not.
Due to the presence of options, the size of the datagram header
can be of variable length (20 bytes to 60 bytes).

5) /6) Explain a classful and classless IPV4 address?


Ans:
 Classful IPV4 Address:
An IP address is an address that has information about
how to reach a specific host, especially outside the LAN. An
IP address is a 32-bit unique address having an address
space of 232.
Classful IP addressing is a way of organizing and
managing IP addresses, which are used to identify devices
on a network. Think of IP addresses like street addresses for
houses; each device on a network needs its unique address
to communicate with other devices. In this article, we will
discuss Classful IP addresses, and their types in detail.
Classful Addressing
The 32-bit IP address is divided into five sub-classes. These
are given below:
 Class A
 Class B
 Class C
 Class D
 Class E
Each of these classes has a valid range of IP addresses.
Classes D and E are reserved for multicast and
experimental purposes respectively. The order of bits in the
first octet determines the classes of the IP address.
The class of IP address is used to determine the bits used
for network ID and host ID and the number of total
networks and hosts possible in that particular class.
Each ISP or network administrator assigns an IP address to
each device that is connected to its network.

Class A
IP addresses belonging to class A are assigned to the
networks that contain a large number of hosts.
 The network ID is 8 bits long.
 The host ID is 24 bits long.

Class B
IP address belonging to class B is assigned to networks that
range from medium-sized to large-sized networks.
 The network ID is 16 bits long.
 The host ID is 16 bits long.

Class C
IP addresses belonging to class C are assigned to small-
sized networks.
 The network ID is 24 bits long.
 The host ID is 8 bits long.

Class D
IP address belonging to class D is reserved for multi-
casting. The higher-order bits of the first octet of IP
addresses belonging to class D is always set to 1110. The
remaining bits are for the address that interested hosts
recognize.

Class E
IP addresses belonging to class E are reserved for
experimental and research purposes. IP addresses of class
E range from 240.0.0.0 – 255.255.255.255. This class
doesn’t have any subnet mask. The higher-order bits of the
first octet of class E are always set to 1111.
 Classless IPV4 Address:
Subnetting
Dividing a large block of addresses into several contiguous
sub-blocks and assigning these sub-blocks to different
smaller networks is called subnetting. It is a practice that is
widely used when classless addressing is done.
A subnet or subnetwork is a network inside a network.
Subnets make networks more efficient. Through subnetting,
network traffic can travel a shorter distance without passing
through unnecessary routers to reach its destination.
Classless Addressing
To reduce the wastage of IP addresses in a block, we use
sub-netting. What we do is that we use host id bits as net id
bits of a classful IP address. We give the IP address and
define the number of bits for mask along with it (usually
followed by a ‘/’ symbol), like, 192.168.1.1/28. Here, subnet
mask is found by putting the given number of bits out of 32
as 1, like, in the given address, we need to put 28 out of 32
bits as 1 and the rest as 0, and so, the subnet mask would
be 255.255.255.240. A classless addressing system or
classless interdomain routing (CIDR or supernetting) is the
way to combine two or more class C networks to create
a/23 or a /22 supernet. A classless addressing system or
classless interdomain routing (CIDR) is an improved IP
addressing system. In a classless addressing system the
block of IP address is assigned dynamically based on
specific rules.
Some Values Calculated in Subnetting:
1. Number of subnets : 2(Given bits for mask – No. of bits in
default mask)
2. Subnet address : AND result of subnet mask and the
given IP address
3. Broadcast address : By putting the host bits as 1 and
retaining the network bits as in the IP address
4. Number of hosts per subnet : 2(32 – Given bits for
mask) – 2
5. First Host ID : Subnet address + 1 (adding one to the
binary representation of the subnet address)
6. Last Host ID : Subnet address + Number of Hosts

7)Compare Network layer protocols IPV4 & IPV6.


Ans:
8)Explain leaky bucket algorithm and compare it with token
bucket algorithm.
Ans:
Traffic Shaping is a mechanism to control the
amount and the rate of traffic sent to the network.
Approach of congestion management is called Traffic
shaping. Traffic shaping helps to regulate the rate of data
transmission and reduces congestion.
There are 2 types of traffic shaping algorithms:
1. Leaky Bucket
2. Token Bucket
Suppose we have a bucket in which we are pouring water,
at random points in time, but we have to get water at a
fixed rate, to achieve this we will make a hole at the bottom
of the bucket. This will ensure that the water coming out is
at some fixed rate, and also if the bucket gets full, then we
will stop pouring water into it.
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.

In the above figure, we assume 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. In the above figure, 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 10 s. The leaky
bucket smooths out the traffic by sending out data at a rate
of 3 Mbps during the same 10 s.
9)Explain TCP flow control.
Ans:
Transmission Control Protocol (TCP) is a connection-
oriented protocol for communications that helps in the
exchange of messages between different devices over a
network. The Internet Protocol (IP), which establishes the
technique for sending data packets between computers,
works with TCP.
The position of TCP is at the transport layer of the OSI
model. TCP also helps in ensuring that information is
transmitted accurately by establishing a virtual connection
between the sender and receiver.
In computer networks, reliable data delivery is
important. The Transmission Control
Protocol guarantees in-order and error-free data
transfer using flow control.
This is to prevent the sender from flooding the
receiver so as to make sure it can work efficiently in
turn.
TCP utilizes a sliding window protocol for flow
control.
The receiver advertises a window size, indicating the
number of bytes its buffer can hold.
The sender transmits data segments up to this
advertised window.
TCP Flow Control Working
1. Handshake: During connection establishment, the
receiver sends its initial window size to the one who is
sender.
2. Sending and Acknowledging: The sender transmits
data segments up to the window size. For each received
segment, the receiver sends an acknowledgment (ACK).
3. Window Adjustment: As the receiver processes data,
the window size adjusts dynamically. A full buffer prompts
the receiver to advertise a smaller window, slowing the
sender. Conversely, a free buffer space leads to a larger
advertised window, allowing the sender to transmit faster.
This dynamic window prevents data loss and optimizes
network performance.
Additionally, TCP uses window scaling to handle larger
window sizes efficiently on high-bandwidth connections.
Employs a persist timer that triggers small data
transmissions even when the window is zero, ensuring the
connection stays alive. By regulating data flow, TCP
prevents receiver overload and contributes to congestion
avoidance within the network.

10)Explain shortest path (Dijkstra’s algorithm) routing


protocol.
Ans:
In between sending and receiving data packets from the
sender to the receiver, it will go through many routers and
subnets. So as a part of increasing the efficiency in routing
the data packets and decreasing the traffic, we must find
the shortest path.
Shortest Path Routing refers to the algorithms that
help to find the shortest path between a sender and
receiver for routing the data packets through the
network in terms of shortest distance, minimum
cost, and minimum time.
Dijkstra’s Algorithm
The Dijkstra’s Algorithm is a greedy algorithm that is
used to find the minimum distance between a node
and all other nodes in a given graph. Here we can
consider node as a router and graph as a network. It
uses weight of edge .ie, distance between the nodes
to find a minimum distance route.
Algorithm:
1: Mark the source node current distance as 0 and all
others as infinity.
2: Set the node with the smallest current distance
among the non-visited nodes as the current node.
3: For each neighbor, N, of the current node:
 Calculate the potential new distance by adding the
current distance of the current node with the weight
of the edge connecting the current node to N.
 If the potential new distance is smaller than the
current distance of node N, update N’s current
distance with the new distance.
4: Make the current node as visited node.
5: If we find any unvisited node, go to step 2 to find
the next node which has the smallest current
distance and continue this process.
Example:
Consider the graph G:

Find Answer to this question

11)Explain link state routing algorithm with an example?


Ans:
Unicast means the transmission from a single sender to a
single receiver. It is a point-to-point communication
between the sender and receiver. There are various unicast
protocols such as TCP, HTTP, etc.
Major Protocols of Unicast Routing
1. Distance Vector Routing: Distance-Vector routers use a
distributed algorithm to compute their routing tables.
2. Link-State Routing: Link-State routing uses link-state
routers to exchange messages that allow each router to
learn the entire network topology.
3. Path-Vector Routing: It is a routing protocol that
maintains the path that is updated dynamically.
Link State Routing
Link state routing is the second family of routing protocols. While
distance-vector routers use a distributed algorithm to compute
their routing tables, link-state routing uses link-state routers to
exchange messages that allow each router to learn the entire
network topology. Based on this learned topology, each router is
then able to compute its routing table by using the shortest path
computation.
Link state routing is a technique in which each router shares the
knowledge of its neighborhood with every other router i.e. the
internet work. The three keys to understand the link state
routing algorithm.
1. Knowledge about the neighborhood: Instead of sending
its routing table, a router sends the information about its
neighborhood only. A router broadcast its identities and
cost of the directly attached links to other routers.
2. Flooding: Each router sends the information to every other
router on the internetwork except its neighbors. This
process is known as flooding. Every router that receives the
packet sends the copies to all the neighbors. Finally each
and every router receives a copy of the same information.
3. Information Sharing: A router send the information to
every other router only when the change occurs in the
information.
Link state routing has two phase:
1. Reliable Flooding: Initial state– Each node knows the
cost of its neighbors. Final state- Each node knows the
entire graph.
2. Route Calculation: Each node uses Dijkstra’ s algorithm
on the graph to calculate the optimal routes to all nodes.
The link state routing algorithm is also known as Dijkstra’s
algorithm which is used to find the shortest path from one
node to every other node in the network.
Features of Link State Routing Protocols
 Link State Packet: A small packet that contains routing
information.
 Link-State Database: A collection of information gathered
from the link-state packet.
 Shortest Path First Algorithm (Dijkstra algorithm): A
calculation performed on the database results in the
shortest path
 Routing Table: A list of known paths and interfaces.
Example:
Consider the below graph and src = 0.
12)Explain DHCP message format and its operation in detail.
Ans:

 Hardware Length: This is an 8-bit field defining the length


of the physical address in bytes. e.g for Ethernet the value
is 6.
 Hop count: This is an 8-bit field defining the maximum
number of hops the packet can travel.
 Transaction ID: This is a 4-byte field carrying an integer.
The transcation identification is set by the client and is
used to match a reply with the request. The server returns
the same value in its reply.
 Number of Seconds: This is a 16-bit field that indicates
the number of seconds elapsed since the time the client
started to boot.
 Flag: This is a 16-bit field in which only the leftmost bit is
used and the rest of the bit should be set to os. A leftmost
bit specifies a forced broadcast reply from the server. If the
reply were to be unicast to the client, the destination. IP
address of the IP packet is the address assigned to the
client.
 Client IP Address: This is a 4-byte field that contains the
client IP address . If the client does not have this
information this field has a value of 0.
 Your IP Address: This is a 4-byte field that contains the
client IP address. It is filled by the server at the request of
the client.
 Server IP Address: This is a 4-byte field containing the
server IP address. It is filled by the server in a reply
message.
 Gateway IP Address: This is a 4-byte field containing the
IP address of a routers. IT is filled by the server in a reply
message.
 Client Hardware Address: This is the physical address of
the client .Although the server can retrieve this address
from the frame sent by the client it is more efficient if the
address is supplied explicity by the client in the request
message.
 Server Name: This is a 64-byte field that is optionally filled
by the server in a reply packet. It contains a null-terminated
string consisting of the domain name of the server. If the
server does not want to fill this filed with data, the server
must fill it with all 0s.
 Boot Filename: This is a 128-byte field that can be
optionally filled by the server in a reply packet. It contains a
null- terminated string consisting of the full pathname of
the boot file. The client can use this path to retrieve other
booting information. If the server does not want to fill this
field with data, the server must fill it with all 0s.
 Options: This is a 64-byte field with a dual purpose. IT can
carry either additional information or some specific vendor
information. The field is used only in a reply message. The
server uses a number, called a magic cookie, in the format
of an IP address with the value of 99.130.83.99. When the
client finishes reading the message, it looks for this magic
cookie. If present the next 60 bytes are options.

DHCP works on the Application layer of the UDP Protocol.


The main task of DHCP is to dynamically assigns IP
Addresses to the Clients and allocate information on TCP/IP
configuration to Clients. For more, you can refer to the
Article Working of DHCP.
The DHCP port number for the server is 67 and for the
client is 68. It is a client-server protocol that uses UDP
services. An IP address is assigned from a pool of
addresses. In DHCP, the client and the server exchange
mainly 4 DHCP messages in order to make a connection,
also called the DORA process, but there are 8 DHCP
messages in the process.
13)Consider a message m(x)=100100 to be transmitte.
Generator polynomial is x^3+x^2+1.What is the actual bit
string transmitted?
Ans:
Data word to be sent - 100100
Key - 1101 [ Or generator polynomial x 3 + x2 + 1]
Sender Side:

Therefore, the remainder is 001 and hence the encoded


data sent is 100100001.
Receiver Side:
Code word received at the receiver side 100100001
Therefore, the remainder is all zeros. Hence, the
data received has no error.

14)A bit stream 1101011011 is transmitted using the


standard CRC method. The generator polynomial is x^4
+x+1. What is the actual bit string transmitted?
Ans:
Given:
1. Bit stream (message): m(x)=1101011011m(x) =
1101011011m(x)=1101011011
2. Generator polynomial: g(x)=x4+x+1g(x) = x^4 + x +
1g(x)=x4+x+1, which corresponds to g(x)=10011g(x) =
10011g(x)=10011 in binary.
Steps to solve:
Step 1: Append zeros to the message
We append n−1n-1n−1 zeros to the message, where nnn is
the number of bits in the generator polynomial. Since
g(x)g(x)g(x) has 5 bits, we append 4 zeros to the message.
Message with zeros appended: 11010110110000\
text{Message with zeros appended: } 1101011011 \
textbf{0000}Message with zeros appended: 110101101100
00
Thus, the augmented message becomes:
11010110110000\text{11010110110000}11010110110000
Step 2: Perform binary division (modulo 2 division)
Now, divide the augmented message
110101101100001101011011000011010110110000 by the
generator polynomial 100111001110011 using modulo 2
division (XOR).

Thus, the remainder obtained from this division is


111011101110.
Final Answer:
The actual bit string transmitted is 11010110111110.

You might also like