Imp Acn
Imp Acn
There are several network layer protocols that are commonly used, each serving a
specific purpose.
• Internet Protocol (IP): This protocol is responsible for addressing and routing data packets across the
internet. It works by assigning a unique numerical address, called an IP address, to each device on a
network. This allows data packets to be forwarded to the correct device based on the IP address.
• Internet Control Message Protocol (ICMP): This protocol is used to transmit error messages and
other information between devices on a network. It is often used to troubleshoot network issues or to
send diagnostic information.
• Address Resolution Protocol (ARP): This protocol is used to map IP addresses to physical
addresses, such as a device’s media access control (MAC) address. This allows devices to
communicate with each other on a network.
• Routing Information Protocol (RIP): The Routing Information Protocol (RIP) is another network
layer protocol that is used to determine the best path for data packets to travel between devices on a
network. It works by sending updates to other devices on the network, allowing them to update their
routing tables and determine the best route for data packets.
• Open Shortest Path First (OSPF) protocol: This is a routing protocol that is used in large networks,
such as enterprise networks or internet service providers. It works by using a link-state database to
determine the best route for data packets and can quickly adapt to changes in the network.
1. Class A
2. Class B
3. Class C
4. Class D
5. Class E
1. Class A
• IP addresses belonging to class A are assigned to the networks that contain a large number of hosts.
2. Class B
• IP address belonging to class B is assigned to networks that range from medium-sized to large-sized
networks.
3. Class C
4. 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.
5. 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.254. This class doesn’t have any subnet mask. The higher-
order bits of the first octet of class E are always set to 1111.
• Routers are used on the network for forwarding a packet from the local network to the remote network.
So, the process of routing involves the packet forwarding from an entry interface out to an exit
interface.
Working:
• The following steps are included in the packet forwarding in the router-
• The router takes the arriving packet from an entry interface and then forwards that packet to another
interface.
Following are the packet forwarding techniques based on the destination host:
• Next-Hop Method: By only maintaining the details of the next hop or next router in the packet’s path,
the next-hop approach reduces the size of the routing table. The routing table maintained using this
method does not have the information regarding the whole route that the packet must take.
• Network-Specific Method: In this method, the entries are not made for all of the destination hosts in
the router’s network. Rather, the entry is made of the destination networks that are connected to the
router.
• Host-Specific Method: In this method, the routing table has the entries for all of the destination hosts
in the destination network. With the increase in the size of the routing table, the efficiency of the
routing table decreases. It finds its application in the process of verification of route and security
purposes.
• Default Method: Let’s assume- A host in network N1 is connected to two routers, one of which
(router R1) is connected to network N2 and the other router R2 to the rest of the internet. As a result,
the routing table only has one default entry for the router R2.
1. Version
• IHL is the number of 32-bit words making up the header field. As the first 20 bytes are mandatory, the
minimum number is 5, and the maximum is 15.
• It specifies the type of service for differentiated services, such as voice-over IP.
• ECN carries a network congestion notification without dropping packets or wasting bandwidth when
supported.
5. Total Length
• It represents the total size of the datagram, including the header and the data segment.
6. Identification
7. Flags
• Different combinations of the flags control the fragmentation and indicate fragmented datagrams.
• For example, if the don’t fragment flag (bit 1) is set to 1, and the destination host can’t assemble the
fragmented packets, it will drop them.
8. Fragment Offset
• The number of hops a packet lives. Each router decrements the TTL field and discards the packet when
it reaches 0. This way, looping packets are eliminated.
10. Protocol
• It’s a checksum for error detection, covering only the header field. Each router checks this value and
discards the packet if an error is detected.
Uncorrupted packets return 0 when summing the whole header, including the checksum itself.
14. Options
• Query Message − It helps a router or a network manager to get specific information from a router or
another host.
4 Source quench
11 Time Exceeded
12 Parameter Problem
5 Redirection
• Source Quench − It requests to decrease the traffic rate of message sending from source to
destination.
• Time Exceeded − When fragments are lost in a network the fragments hold by the router will be
dropped and then ICMP will take the source IP from the discarded packet and inform the source, that
datagram is discarded due to the time to live field reaches zero, by sending time exceeded message.
• Fragmentation Required − When a router is unable to forward a datagram because it exceeds the
MTU of the next-hop network and the DF (Don't Fragment) bit is set, the router is required to return an
ICMP Destination Unreachable message to the source of the datagram, with the Code indicating
fragmentation is needed and DF (Don’t Fragment) set.
• Destination Unreachable − This error message indicates that the destination host, network, or port
number that is specified in the IP packet is unreachable
Redirect Message − A redirect error message is used when a router needs to tell a sender that it
should use a different path for a specific destination. It occurs when the router knows a shorter path
to the destination.
Internet Protocol version 6 (IPv6) is the latest revision of the Internet Protocol (IP) and the first version
of the protocol to be widely deployed. IPv6 was developed by the Internet Engineering Task Force
(IETF) to deal with the long-anticipated problem of IPv4 address exhaustion.
IPv6 protocol responds to the above issues using the following main changes in the protocol:
0000 01 UA 1/64
0000 1 UA 1/32
0001 UA 1/16
010 UA 1/8
011 UA 1/8
100 UA 1/8
101 UA 1/8
110 UA 1/8
1110 UA 1/16
1111 0 UA 1/32
1111 10 UA 1/64
IPv6 addresses are assigned to organizations in much larger blocks as compared to IPv4 address assignments—
the recommended allocation is a /48 block which contains 280 addresses, being 248 or about 2.8×1014 times
larger than the entire IPv4 address space of 232 addresses and about 7.2×1016 times larger than the /8 .
The wonder of IPv6 lies in its header. An IPv6 address is 4 times larger than IPv4, but surprisingly, the header
of an IPv6 address is only 2 times larger than that of IPv4. IPv6 headers have one Fixed Header and zero or
more Optional (Extension) Headers. All the necessary information that is essential for a router is kept in the
Fixed Header. The Extension Header contains optional information that helps routers to understand how to
handle a packet/flow.
In IPv6, the Fixed Header contains only that much information which is necessary, avoiding those information
which is either not required or is rarely used. All such information is put between the Fixed Header and the
Upper layer header in the form of Extension Headers. Each Extension Header is identified by a distinct value.
These headers:
1. should be processed by First and subsequent destinations.
2. should be processed by Final Destination.
Extension Headers are arranged one after another in a linked list manner, as depicted in the following diagram:
Destination unreachable: The message of "Destination Unreachable" is sent from receiver to the sender when
destination cannot be reached, or packet is discarded when the destination is not reachable.
Source Quench: The purpose of the source quench message is congestion control. The message sent from the
congested router to the source host to reduce the transmission rate. ICMP will take the IP of the discarded
packet and then add the source quench message to the IP datagram to inform the source host to reduce its
transmission rate. The source host will reduce the transmission rate so that the router will be free from
congestion.
Time Exceeded: Time Exceeded is also known as "Time-To-Live". It is a parameter that defines how long a
packet should live before it would be discarded.
Parameter problems: When a router or host discovers any missing value in the IP datagram, the router
discards the datagram, and the "parameter problem" message is sent back to the source host.
Redirection: Redirection message is generated when host consists of a small routing table. When the host
consists of a limited number of entries due to which it sends the datagram to a wrong router. The router that
receives a datagram will forward a datagram to a correct router and also sends the "Redirection message" to the
host to update its routing table.
Q.7 Write short note on: ICMPv6 informational messages, Neighbor-Discovery Messages&
Group Membership Messages.
Ans.
ICMPv6 informational messages: ICMPv6 informational messages are used for network diagnostic functions
and additional critical network functions like Neighbor Discovery, Router Solicitation & Router.
Advertisements, Multicast Memberships. Echo Request and Echo Reply (used by many commands and utilities
like "ping" for network diagnostics and communication trouble shooting) are also ICMPv6 informational
Prepared By: Department of Computer Engineering Page 12
Subject Name: Advanced Computer Network Subject Code: 4350706
messages. The ICMPv6 informational messages have values for the Type field (8 bit binary number) between
128 and 255.
. Neighbor-Discovery Messages: ICMPv6 ND (Neighbor Discovery) Messages are used for the Neighbor
Discovery Protocol (NDP). ND (Neighbor Discovery) Messages includes Router Solicitation & Router
Advertisement, Neighbor Solicitation and Neighbor Advertisement.
Group Membership Messages: ICMPv6 MLD (Multicast Listener Discovery) Messages are used by an IPv6
enabled router to discover hosts who are interested in multicast packets, and the multicast addresses they are
interested. MLD (Multicast Listener Discovery) messages are used by MLD (Multicast Listener Discovery)
Protocol. MLD (Multicast Listener Discovery) Protocol is the IPv6 equivalent of IGMP (Internet Group
Management) Protocol in IPv4.
Tunneling
In a scenario where different IP versions exist on intermediate path or transit networks, tunneling
provides a better solution where user‟s data can pass through a non-supported IP version.
Unit-3Unicast Routing
Q.1 ExplainRouting.
Ans.
When a device has multiple paths to reach a destination, it always selects one path by preferring it over others.
This selection process is termed as Routing. Routing is done by special network devices called routers or it can
be done by means of software processes. Thesoftware based routers have limited functionality and limited
scope. A router is always configured with some default route. A default route tells the router where to forward a
packet if there is no route found for specific destination. In case there are multiple path existing to reach the
same destination, router can make decision based on the following information:
Hop Count
Bandwidth
Metric
Prefix-length
Delay
Routes can be statically configured or dynamically learnt. One route can be configured to be preferred over
others.
Initialization
The tables in above Figure are stable; each node knows how to reach any other node and the cost.
Sharing
The whole idea of distance vector routing is the sharing of information between neighbors. Although node A
does not know about node E, node C does. So if node C shares its routing table with A, node A can also know
how to reach node E.
Updating
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.
including the type, cost (metric), and condition of the links (up or down)-the node can use Dijkstra's algorithm
to build a routing table.
Types of Links
Command: It is an 8-bit field that is used for request or reply. The value of the request is 1, and the value of the
reply is 2.
o Version: Here, version means that which version of the protocol we are using. Suppose we are using the
protocol of version1, then we put the 1 in this field.
o Reserved: This is a reserved field, so it is filled with zeroes.
o Family: It is a 16-bit field. As we are using the TCP/IP family, so we put 2 value in this field.
o Network Address: It is defined as 14 bytes field. If we use the IPv4 version, then we use 4 bytes, and the
other 10 bytes are all zeroes.
o Distance: The distance field specifies the hop count, i.e., the number of hops used to reach the destination.
o Addressing
o Reliable delivery
o Flow control
o Multiplexing
Where,
o Source port address: It is used to define the address of the application program in a source computer. It is a
16-bit field.
o Destination port address: It is used to define the address of the application program in a destination
computer. It is a 16-bit field.
o Sequence number: A stream of data is divided into two or more TCP segments. The 32-bit sequence
number field represents the position of the data in an original data stream.
o Acknowledgement number: A 32-field acknowledgement number acknowledge the data from other
communicating devices. If ACK field is set to 1, then it specifies the sequence number that the receiver is
expecting to receive.
o Header Length (HLEN): It specifies the size of the TCP header in 32-bit words. The minimum size of the
header is 5 words, and the maximum size of the header is 15 words. Therefore, the maximum size of the TCP
header is 60 bytes, and the minimum size of the TCP header is 20 bytes.
o Reserved: It is a six-bit field which is reserved for future use.
o Control bits: Each bit of a control field functions individually and independently. A control bit defines the
use of a segment or serves as a validity check for other fields.
The Stream Control Transmission Protocol (SCTP) has a simpler basic packet structure than TCP. Each
consists of two basic sections:
1. The common header, which occupies the first 12 bytes. In the adjacent diagram, this header is highlighted in
blue.
2. The data chunks, which form the remaining portion of the packet. In the diagram, the first chunk is
highlighted in green and the last of N chunks (Chunk N) is highlighted in red. There are several types, including
payload data and different control messages.
All SCTP packets require the common header section (shown with a blue background).
Source port This field identifies the sending port.
Destination port This field identifies the receiving port that hosts use to route the packet to the
appropriate endpoint/application.
Verification tag
A 32-bit random value created during initialization to distinguish stale packets from a previous
connection.
Checksum
SCTP's original design catered for Adler-32; but RFC 3309 changed the protocol to use the
CRC32c algorithm.
1. TELNET
• Telnet stands for the Teletype Network. It helps in terminal emulation. It allows Telnet clients
to access the resources of the Telnet server. Port number of telnet is 23.
2. FTP
• FTP stands for File Transfer Protocol. It is the protocol that actually lets us transfer files. It can
facilitate this between any two machines using it.
3. TFTP
• The Trivial File Transfer Protocol (TFTP) is the stripped-down, stock version of FTP, but it’s
the protocol of choice if you know exactly what you want and where to find it.The Port number
for TFTP is 69.
4. NFS
5. SMTP
• It stands for Simple Mail Transfer Protocol. It is a part of the TCP/IP protocol.
6. LPD
• It stands for Line Printer Daemon. It is designed for printer sharing. It is the part that receives
and processes the request. A “daemon” is a server or agent. The Port number for LPD is 515.
7. X window
• It defines a protocol for the writing of graphical user interface–based client/server applications.
Prepared By: Department of Computer Engineering Page 25
Subject Name: Advanced Computer Network Subject Code: 4350706
8. SNMP
• It stands for Simple Network Management Protocol. The Port number of SNMP is 161(TCP)
and 162(UDP).
9. DNS
10. DHCP
• It stands for Dynamic Host Configuration Protocol (DHCP). It gives IP addresses to hosts.
11. HTTP/HTTPS
• HTTP stands for Hypertext Transfer Protocol and HTTPS is the more secured version of
HTTP, that’s why HTTPS stands for Hypertext Transfer Protocol Secure.
12. POP
• POP stands for Post Office Protocol and the latest version is known as POP3 (Post Office
Protocol version 3). This is a simple protocol used by User agents for message retrieval from
mail servers.
13. IRC
• IRC stands for Internet Relay Chat. It is a text-based instant messaging/chatting system. IRC is
used for group or one-to-one communication.
14. MIME
• MIME stands for Multipurpose Internet Mail Extension. This protocol is designed to extend the
capabilities of the existing Internet email protocol like SMTP
Objectives of FTP
Mechanism of FTP
• The above figure shows the basic model of the FTP. The FTP client has three components: the user
interface, control process, and data transfer process. The server has two components: the server control
process and the server data transfer process.
o Control Connection: The control connection uses very simple rules for communication. Through control
connection, we can transfer a line of command or line of response at a time. The control connection is
made between the control processes. The control connection remains connected during the entire
interactive FTP session.
o Data Connection: The Data Connection uses very complex rules as data types may vary. The data
connection is made between data transfer processes. The data connection opens when a command comes
for transferring the files and closes when the file is transferred.
• The main purpose of SMTP is used to set up communication rules between servers. The servers have a
way of identifying themselves and announcing what kind of communication they are trying to perform.
They also have a way of handling the errors such as incorrect email address. For example, if the
recipient address is wrong, then receiving server reply with an error message of some kind.
Components of SMTP
• First, we will break the SMTP client and SMTP server into two components such as user agent (UA)
and mail transfer agent (MTA). The user agent (UA) prepares the message, creates the envelope and
then puts the message in the envelope. The mail transfer agent (MTA) transfers this mail across the
internet.
• SMTP allows a more complex system by adding a relaying system. Instead of just having one MTA at
sending side and one at receiving side, more MTAs can be added, acting either as a client or server to
relay the email.
• The relaying system without TCP/IP protocol can also be used to send the emails to users, and this is
achieved by the use of the mail gateway. The mail gateway is a relay MTA that can be used to receive
an email.
Advantages of SMTP
Disadvantages of SMTP
• The MIME protocol allows the users to exchange various types of digital content such as pictures, audio,
video, and various types of documents and files in the e-mail.
• MIME was created in 1991 by a computer scientist named Nathan Borenstein at a company called Bell
Communications.
MIME protocol is used to transfer e-mail in the computer network for the following reasons:
1. The MIME protocol supports multiple languages in e-mail, such as Hindi, French, Japanese, Chinese, etc.
2. Simple protocols can reject mail that exceeds a certain size, but there is no word limit in MIME.
3. Images, audio, and video cannot be sent using simple e-mail protocols such as SMTP. These require MIME
protocol.
4. Many times, emails are designed using code such as HTML and CSS, they are mainly used by companies for
marketing their product. This type of code uses MIME to send email created from HTML and CSS.
MIME Header
MIME adds five additional fields to the header portion of the actual e-mail to extend the properties of the
simple email protocol. These fields are as follows:
1. MIME Version
2. Content Type
3. Content Type Encoding
4. Content Id
5. Content description
1. MIME Version
It defines the version of the MIME protocol. This header usually has a parameter value 1.0, indicating that the
message is formatted using MIME.
2. Content Type
It describes the type and subtype of information to be sent in the message. These messages can be of many
types such as Text, Image, Audio, Video, and they also have many subtypes such that the subtype of the image
can be png or jpeg. Similarly, the subtype of Video can be WEBM, MP4 etc.
In this field, it is told which method has been used to convert mail information into ASCII or Binary number,
such as 7-bit encoding, 8-bit encoding, etc.
4. Content Id
In this field, a unique "Content Id" number is appended to all email messages so that they can be uniquely
identified.
5. Content description
This field contains a brief description of the content within the email. This means that information about
whatever is being sent in the mail is clearly in the "Content Description". This field also provides the
information of name, creation date, and modification date of the file.
o For example, suppose the FTP site at EduSoft had an IP address of 132.147.165.50, most people would
reach this site by specifying ftp.EduSoft.com. Therefore, the domain name is more reliable than IP
address.
Generic Domains
o It defines the registered hosts according to their generic behavior.
o Each node in a tree defines the domain name, which is an index to the DNS database.
o It uses three-character labels, and these labels describe the organization type.
Label Description
Country Domain
o The format of country domain is same as a generic domain, but it uses two-character country
abbreviations (e.g., us for the United States) in place of three character organizational abbreviations.
Inverse Domain
o The inverse domain is used for mapping an address to a name. When the server has received a request
from the client, and the server contains the files of only authorized clients. To determine whether the
client is on the authorized list or not, it sends a query to the DNS server and ask for mapping an address
to the name.