CN Midanswers
CN Midanswers
1. Bandwidth required is less due to local 1.Bndwidth required is more due to flooding
sharing, small packets and no flooding. and sending of large link state packets.
2.Based on local knowledge since it updates 2.Based on global knowledge i.e. It have
table based on information from neighbors. knowledge about entire network.
3. Make use of Bellman Ford algo 3.Make use of Dijkastra’s algo
4. Traffic is less. 4.Traffic is more.
5. Converges slowly i.e. good news spread 5.Coverges faster.
fast and bad news spread slowly. 6.No count to infinity problem
6. Count to infinity problem. 7.No persistent loops, only transient loops.
7. Persistent looping problem i.e loop will 8.Practical implementation is OSPF and ISIS.
there forever.
8.Practical implementation is RIP and IGRP.
2.Compare connection oriented and connection less services provided by the network layer.
●
o URG: urgent pointer. When this bit is set, the data should be treated as priority over
other data.
o ACK: used for the acknowledgment.
o PSH: this is the push function. This tells an application that the data should be
transmitted immediately and that we don’t want to wait to fill the entire TCP
segment.
o RST: this resets the connection, when you receive this you have to terminate the
connection right away. This is only used when there are unrecoverable errors and it’s
not a normal way to finish the TCP connection.
o SYN: we use this for the initial three way handshake and it’s used to set the initial
sequence number.
o FIN: this finish bit is used to end the TCP connection. TCP is full duplex so both
parties will have to use the FIN bit to end the connection. This is the normal method
how we end an connection.
● Window: the 16 bit window field specifies how many bytes the receiver is willing to receive.
It is used so the receiver can tell the sender that it would like to receive more data than what
it is currently receiving. It does so by specifying the number of bytes beyond the sequence
number in the acknowledgment field.
● Checksum: 16 bits are used for a checksum to check if the TCP header is OK or not.
● Urgent pointer: these 16 bits are used when the URG bit has been set, the urgent pointer is
used to indicate where the urgent data ends.
● Options: this field is optional and can be anywhere between 0 and 320 bits.
4.Explain congestion control in TCP.
TCP uses a congestion window and a congestion policy that avoid congestion. Previously, we
assumed that only the receiver can dictate the sender’s window size. We ignored another entity
here, the network. If the network cannot deliver the data as fast as it is created by the sender, it must
tell the sender to slow down. In other words, in addition to the receiver, the network is a second
entity that determines the size of the sender’s window.
Congestion policy in TCP –
1. Slow Start Phase: starts slowly increment is exponential to threshold
2. Congestion Avoidance Phase: After reaching the threshold increment is by 1
3. Congestion Detection Phase: Sender goes back to Slow start phase or Congestion
avoidance phase.
Slow Start Phase : exponential increment – In this phase after every RTT the congestion window
size increments exponentially.
Initially cwnd = 1
After 1 RTT, cwnd = 2^(1) = 2
2 RTT, cwnd = 2^(2) = 4
3 RTT, cwnd = 2^(3) = 8
Congestion Avoidance Phase : additive increment – This phase starts after the threshold value also
denoted as ssthresh. The size of cwnd(congestion window) increases additive. After each RTT cwnd =
cwnd + 1.
Initially cwnd = i
After 1 RTT, cwnd = i+1
2 RTT, cwnd = i+2
3 RTT, cwnd = i+3
Congestion Detection Phase : multiplicative decrement – If congestion occurs, the congestion
window size is decreased. The only way a sender can guess that congestion has occurred is the need
to retransmit a segment. Retransmission is needed to recover a missing packet that is assumed to
have been dropped by a router due to congestion. Retransmission can occur in one of two cases:
when the RTO timer times out or when three duplicate ACKs are received.
● Case 1 : Retransmission due to Timeout – In this case congestion possibility is high.
(a) ssthresh is reduced to half of the current window size.
(b) set cwnd = 1
(c) start with slow start phase again.
● Case 2 : Retransmission due to 3 Acknowledgement Duplicates – In this case congestion
possibility is less.
(a) ssthresh value reduces to half of the current window size.
(b) set cwnd= ssthresh
(c) start with congestion avoidance phase
5.Explain how domain name is converted to IP address?
You can see the original domain name and respective IP Address of that domain name.
File transfer protocol (FTP) is an Internet tool provided by TCP/IP. The first feature of FTP is
developed by Abhay Bhushan in 1971. It helps to transfer files from one computer to another by
providing access to directories or folders on remote computers and allows software, data, text file to
be transferred between different kinds of computers. The end-user in the connection is known as
localhost and the server which provides data is known as the remote host.
● At the very beginning, each network participant does not have an IP address. The
network administrator then provides each host on the network with a unique IP address
using the IPv4 protocol.
● The client installs the BOOTP network protocol using TCP / IP Intervention on its
computer system to ensure compatibility with all network protocols when connected to
this network.
● The BOOTP network administrator then sends a message that contains a valid unicast
address. This unicast address is then forwarded to the BOOTP client by the master server.
● Bootstrap (BOOTP) is primarily required to check the system on a network the first time
you start your computer. Records the BIOS cycle of each computer on the network to
allow the computer’s motherboard and network manager to efficiently organize the data
transfer on the computer as soon as it boots up.
● BOOTP is mainly used in a diskless environment and requires no media as all data is
stored in the network cloud for efficient use.
● BOOTP is the transfer of a data between a client and a server to send and receive
requests and corresponding responses by the networking server.
● BOOTP supports the use of motherboards and network managers, so no external storage
outside of the cloud network is required.
7.What is the major problem of IPV4 protocol? What are the solutions?
IPv4 addresses are 32-bit and provide 4,294,967,296 unique addresses. Special address blocks are
reserved for private networks and multicast addresses.
Such a number of addresses has become insufficient for the current number of worldwide devices
connected to the Internet. However, IPv4 is still the Internet Protocol that routes most of the Internet
traffic, as IPv6 adoption is taking place at a slow pace.
The rapidly growing number of Internet users and the increase in mobile devices accelerated the
depletion. So, new technologies were developed and adopted to slow it down. For instance:
User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of the Internet
Protocol suite, referred to as UDP/IP suite. Unlike TCP, it is an unreliable and connectionless
protocol. So, there is no need to establish a connection prior to data transfer. The UDP helps
to establish low-latency and loss-tolerating connections establish over the network.The UDP
enables process to process communication.
1. Source Port: Source Port is a 2 Byte long field used to identify the port number of the
source.
2. Destination Port: It is a 2 Byte long field, used to identify the port of the destined packet.
3. Length: Length is the length of UDP including the header and the data. It is a 16-bits field.
4. Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s complement of the one’s
complement sum of the UDP header, the pseudo-header of information from the IP
header, and the data, padded with zero octets at the end (if necessary) to make a multiple
of two octets.
Transmission Control Protocol (TCP) is a standard that defines how to establish and maintain
a network conversation by which applications can exchange data.
TCP works with the Internet Protocol (IP), which defines how computers send packets of
data to each other. Together, TCP and IP are the basic rules that define the internet.
Source Port
It is a 16-bit source port number used by the receiver to reply.
Destination Port
It is a 16-bit destination port number.
Sequence Number
The sequence number of the first data byte in this segment. During the SYN Control bit is
set, and the sequence number is n, and the first data byte is n + 1.
Acknowledgement Number
If the ACK control bit is set, this field contains the next number that the receiver expects to
receive.
Data Offset
The several 32-bit words in the TCP header shows from where the user data begins.
Reserved (6 bit)
It is reserved for future use.
URG
It indicates an urgent pointer field that data type is urgent or not.
ACK
It indicates that the acknowledgement field in a segment is significant, as discussed early.
PUSH
The PUSH flag is set or reset according to a data type that is sent immediately or not.
RST:
It Resets the connection.
SYN
It synchronizes the sequence number.
FIN
This indicates no more data from the sender.
Window
It is used in Acknowledgement segment. It specifies the number of data bytes, beginning
with the one indicated in the acknowledgement number field that the receiver is ready to
accept.
Checksum
It is used for error detection.
Options
The IP datagram options provide additional punctuality. It can use several optional
parameters between a TCP sender and receiver. It depends on the options used. The length
of the field may vary in size, but it can't be larger than 40 bytes due to the header field's
size, which is 4 bit.
The most typical option is the maximum segment size MASS option. A TCP receiver
communicates to the TCP sender the total length of the segment it can accept with this
option. The other various options are used for flow control and congestion control, each
explained in the table shown in the table.
Padding
Options in each may vary in size, and it may be necessary to "pad" the TCP header with
zeros so that the segment ends on a 32-bit word boundary as per the standard.
Data
Although in some cases like acknowledgement segments with no data in the reverse
direction, the variable-length field carries the application data from sender to receiver. This
field, connected with the TCP header fields, constitute a TCP segment.
When UDP preferred to TCP:
▪ when all the data must be fully received before any part of it is considered useful
Dijkstra’s Algorithm
Input − A graph representing the network; and a source node, s
Output − A shortest path tree, spt[], with s as the root node.
Initializations −
● An array of distances dist[] of size |V| (number of nodes), where dist[s] = 0 and dist[u] = ∞
(infinite), where u represents a node in the graph except s.
● An array, Q, containing all nodes in the graph. When the algorithm runs into completion, Q will
become empty.
● An empty set, S, to which the visited nodes will be added. When the algorithm runs into
completion, S will contain all the nodes in the graph.
● Repeat while Q is not empty −
o Remove from Q, the node, u having the smallest dist[u] and which is not in S. In the first
run, dist[s] is removed.
o Add u to S, marking u as visited.
o For each node v which is adjacent to u, update dist[v] as −
▪ If (dist[u] + weight of edge u-v) < dist[v], Then
▪ Update dist[v] = dist[u] + weight of edge u-v
● The array dist[] contains the shortest path from s to every other node.
● Example
● The working of the algorithm can be best understood using an example. Consider the
following graph having nodes marked from A to G, connected by weighted edges as follows −
Pass 3 − We choose node C from Q since it has the lowest dist[] value of 6 and put it in S. The neighbouring nodes of C are D and F. We
update dist[] values corresponding to D and F. So the values of the data structures become −
● dist[7]={0,5,6,8,13,10,∞}
● Q={D,E,F,G}
● S={A,B,C}
The distances and shortest paths after this pass are −
Pass 4 − We choose node D from Q since it has the lowest dist[] value of 8 and put it in S.
The neighbouring nodes of D are E, F and G. We update dist[] values corresponding to E, F and G.
So the values of the data structures become −
● dist[7]={0,5,6,8,10,10,18}
● Q={E,F,G}
● S={A,B,C,D}
The distances and shortest paths after this pass are −
Pass 5 − We can choose either node E or node F from Q since both of them have the
lowest dist[] value of 10. We select any one of them, say E, and put it in S. The neighbouring nodes
of D is G. We update dist[] values corresponding to G. So the values of the data structures become
−
● dist[7]={0,5,6,8,10,10,13}
● Q={F,G}
● S={A,B,C,D,E}
The distances and shortest paths after this pass are −
Pass 6 − We choose node F from Q since it has the lowest dist[] value of 10 and put it in S.
The neighbouring nodes of F is G. The dist[] value corresponding to G is less than that through F.
So it remains same. The values of the data structures become −
● dist[7]={0,5,6,8,10,10,13}
● Q={G}
● S={A,B,C,D,E,F}
The distances and shortest paths after this pass are −
Pass 7 − There is just one node in Q. We remove it from Q put it in S. The dist[] array
needs no change. Now, Q becomes empty, S contains all the nodes and so we come to the end of the
algorithm. We eliminate all the edges or routes that are not in the path of any route. So the shortest
path tree from source node A to all other nodes are as follows –
10. Mention the record types of DNS resource record.
The domain name system, or DNS, is a global system responsible for mapping human-readable
hostnames to their corresponding Internet Protocol (IP) addresses. For example, if you want to
access a website using a domain name like example.com, that domain name must point to a valid IP
address.
A record
AAAA record
CNAME record
1. A record
The A record is the most important DNS record type. The "A" in A record stands for "address." An A
record shows the IP address for a specific hostname or domain. For example, a DNS record lookup for
the domain example.com returns the following result:
2. AAAA record
AAAA record, just like A record, point to the IP address for a domain. However, this DNS record type
is different in the sense that it points to IPV6 addresses.
IPV6 is an upgrade over IPV4 as it offers more IP addresses. As a result, IPV6 solves the issue of
running out of unique IP addresses. An IPV6 address looks something like the following:
3001:0db7:3c5d:0024:0000:0000:1a2f:3c1b
3. CNAME record
CNAME—or, in full, "canonical name"—is a DNS record that points a domain name (an alias) to
another domain. In a CNAME record, the alias doesn't point to an IP address. And the domain name
that the alias points to is the canonical name. For example, the subdomain ng.example.com can
point to example.com using CNAME. Here example.com points to the actual IP address using an A
record.
4. NS record
A nameserver (NS) record specifies the authoritative DNS server for a domain. In other words, the NS
record helps point to where internet applications like a web browser can find the IP address for a
domain name. Usually, multiple nameservers are specified for a domain. For example, these could
look like ns1.examplehostingprovider.com and ns2.examplehostingprovider.com.
5. MX record
A mail exchange (MX) record, is a DNS record type that shows where emails for a domain should be
routed to. In other words, an MX record makes it possible to direct emails to a mail server.
You can have multiple MX records for a single domain name. And what this means is that you can
have backup email servers. The following shows an example of a domain with multiple MX records:
From the above table, the MX record with priority 10 will be the primary mail server, while the
secondary server will only be used when the primary server is unavailable (or fails to send emails).
The lower the priority value, the higher the actual priority.
The World Wide Web is abbreviated as WWW and is commonly known as the web. The WWW was
initiated by CERN (European library for Nuclear Research) in 1989. WWW can be defined as the
collection of different websites around the world, containing different information shared via local
servers(or computers).
System Architecture:
From the user’s point of view, the web consists of a vast, worldwide connection of documents or web
pages. Each page may contain links to other pages anywhere in the world. The pages can be retrieved
and viewed by using browsers of which internet explorer, Netscape Navigator, Google Chrome, etc
are the popular ones. The browser fetches the page requested interprets the text and formatting
commands on it, and displays the page, properly formatted, on the screen.
The basic model of how the web works are shown in the figure below. Here the browser is displaying
a web page on the client machine. When the user clicks on a line of text that is linked to a page on
the abd.com server, the browser follows the hyperlink by sending a message to the abd.com server
asking it for the page.
Here the browser displays a web page on the client machine when the user clicks on a line of text that
is linked to a page on abd.com, the browser follows the hyperlink by sending a message to the
abd.com server asking for the page.
Electronic Mail (e-mail) is one of most widely used services of Internet. This service allows an
Internet user to send a message in formatted manner (mail) to the other Internet user in any part of
world. Message in mail not only contain text, but it also contains images, audio and videos data. The
person who is sending mail is called sender and person who receives mail is called recipient. It is just
like postal mail service. Components of E-Mail System : The basic components of an email system
are : User Agent (UA), Message Transfer Agent (MTA), Mail Box, and Spool file. These are explained
as following below.
1.User Agent (UA) : The UA is normally a program which is used to send and receive mail.
Sometimes, it is called as mail reader. It accepts variety of commands for composing, receiving and
replying to messages as well as for manipulation of the mailboxes.
2.Message Transfer Agent (MTA) : MTA is actually responsible for transfer of mail from one system
to another. To send a mail, a system must have client MTA and system MTA. It transfer mail to
mailboxes of recipients if they are connected in the same machine. It delivers mail to peer MTA if
destination mailbox is in another machine. The delivery from one MTA to another MTA is done by
Simple Mail Transfer Protocol.
3.Mailbox : It is a file on local hard drive to collect mails. Delivered mails are present in this file. The
user can read it delete it according to his/her requirement. To use e-mail system each user must have
a mailbox . Access to mailbox is only to owner of mailbox.
4.Spool file : This file contains mails that are to be sent. User agent appends outgoing mails in this
file using SMTP. MTA extracts pending mail from spool file for their delivery. E-mail allows one name,
an alias, to represent several different e-mail addresses. It is known as mailing list, Whenever user
have to sent a message, system checks recipient’s name against alias database. If mailing list is
present for defined alias, separate messages, one for each entry in the list, must be prepared and
handed to MTA. If for defined alias, there is no such mailing list is present, name itself becomes
naming address and a single message is delivered to mail transfer entity.
ICMP:
● The ICMP is a network layer protocol used by hosts and routers to send the notifications of IP
datagram problems back to the sender.
● ICMP uses echo test/reply to check whether the destination is reachable and responding.
● ICMP handles both control and error messages, but its main function is to report the error but
not to correct them.
● An IP datagram contains the addresses of both source and destination, but it does not know
the address of the previous router through which it has been passed. Due to this reason, ICMP
can only send the messages to the source, but not to the immediate routers.
● ICMP protocol communicates the error messages to the sender. ICMP messages cause the
errors to be returned back to the user processes.
● The second field specifies the reason for a particular message type.
ARP:
● Each device on the network is recognized by the MAC address imprinted on the NIC.
Therefore, we can say that devices need the MAC address for communication on a local area
network. MAC address can be changed easily. For example, if the NIC on a particular machine
fails, the MAC address changes but IP address does not change. ARP is used to find the MAC
address of the node when an internet address is known.
If the host wants to know the physical address of another host on its network, then it sends an ARP
query packet that includes the IP address and broadcast it over the network. Every host on the
network receives and processes the ARP packet, but only the intended recipient recognizes the IP
address and sends back the physical address. The host holding the datagram adds the physical
address to the cache memory and to the datagram header, then sends back to the sender.
Steps taken by ARP protocol:
If a device wants to communicate with another device, the following steps are taken by the device:
● The device will first look at its internet list, called the ARP cache to check whether an IP
address contains a matching MAC address or not. It will check the ARP cache in command
prompt by using a command arp-a.
● If ARP cache is empty, then device broadcast the message to the entire network asking each
device for a matching MAC address.
● The device that has the matching IP address will then respond back to the sender with its
MAC address
● Once the MAC address is received by the device, then the communication can take place
between two devices.
● If the device receives the MAC address, then the MAC address gets stored in the ARP cache.
We can check the ARP cache in command prompt by using a command arp -a.
There are two types of ARP entries:
● Dynamic entry: It is an entry which is created automatically when the sender broadcast its
message to the entire network. Dynamic entries are not permanent, and they are removed
periodically.
● Static entry: It is an entry where someone manually enters the IP to MAC address association
by using the ARP command utility.