Olap
Olap
ARP
o ARP stands for Address Resolution Protocol.
o It is used to associate an IP address with the MAC address.
o 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.
o 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..
o If ARP cache is empty, then device broadcast the message to the entire network asking each
device for a matching MAC address.
o matching IP address will then respond back to the sender with its MAC
The device that has the matching
address
o Once the MAC address is received by the device, then the communication can take place between
two devices.
o If the device receives the MAC address, then the MAC address gets stored in the ARP cache. We
a.
can check the ARP cache in command prompt by using a command arp -a.
In the above screenshot, we observe the association of IP address to the MAC address.
RARP
o RARP stands for Reverse Address Resolution Protocol
Protocol.
o If the host wants to know its IP address, then it broadcast the RARP query packet that contains its
ress to the entire network. A RARP server on the network recognizes the RARP packet
physical address
and responds back with the host IP address.
o The protocol which is used to obtain the IP address from a server is known as Reverse Address
Resolution Protocol.
o The message format
ormat of the RARP protocol is similar to the ARP protocol.
o Like ARP frame, RARP frame is sent from one machine to another encapsulated in the data
portion of a frame.
ICMP
o ICMP stands for Internet Control Message Protocol.
o The ICMP is a network layer protocol used by hosts and routers to send the notifications of IP
datagram problems back to the sender.
o ICMP uses echo test/reply to check whether the destination is reachable and responding.
o function is to report the error but not
ICMP handles both control and error messages, but its main function
to correct them.
o 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.
o ICMP protocol communicates the error messages to the sender. ICMP messages cause the errors
to be returned back to the user processes.
o ICMP messages are transmitted within IP datagram.
Error Reporting
ICMP protocol reports the error messages to the sender.
o Destination unreachable
o Source Quench
o Time Exceeded
o Parameter problems
o Redirection
o 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.
o 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
transmis 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.
o Live". It is a parameter that defines how
Time Exceeded: Time Exceeded is also known as "Time-To-Live".
"Time
long a packet should live before it would be discarded.
There are two ways when Time Exceeded message can be generated:
rded due to some bad routing implementation, and this causes the looping issue
Sometimes packet discarded
and network congestion. Due to the looping issue, the value of TTL keeps on decrementing, and when it
reaches zero, the router discards the datagram. However, when the datagram is discarded by the router,
the time exceeded message will be sent by the router to the source host.
When destination host does not receive all the fragments in a certain time limit, then the received
fragments are also discarded, and the destination host sends time Exceeded message to the source host.
o 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.
o 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
corr router and also
sends the "Redirection message" to the host to update its routing table.
IGMP
o IGMP stands for Internet Group Message Protocol.
Protocol
o The IP protocol supports two types of communication:
o and one receiver. Therefore, we
Unicasting: It is a communication between one sender and
can say that it is one-to-one
one communication.
o Multicasting: Sometimes the sender wants to send the same message to a large number
of receivers simultaneously. This process is known as multicasting which has one-to-many
one
communication.
o The IGMP protocol is used by the hosts and router to support multicasting.
o The IGMP protocol is used by the hosts and router to identify the hosts in a LAN that are the
members of a group.
Type: It determines the type of IGMP message. There are three types of IGMP message: Membership
Query, Membership Report and Leave Report.
Maximum Response Time: This field is used only by the Membership Query message. It determines the
maximum time the host can send the Membership Report message in response to the Membership Query
message.
Group Address: The behavior of this field depends on the type of the message sent.
o For Membership Query,, the group address is set to zero for General Query and set to multicast
group address for a specific query.
o For Membership Report,, the group address is set to the multicast group address.
o For Leave Group,, it is set to the multicast group address.
IGMP Messages
Routing algorithm
o In order to transfer the packets from source to the destination, the network layer must determine
the best route through which packets can be transmitted.
o Whether the network layer provides datagram service or virtual circuit service, the main job of the
network layer is to provide the best route. The routing protocol provides this job.
o The routing protocol is a routing algorithm that provides the best path from the source to the
"least cost path" from source to the
destination. The best path is the path that has the "least-cost
destination.
o Routing is the process of forwarding the packets from source to the destination but the best
route to send the packets is determined by the routing algorithm.
o Centralized algorithm: It is also known as global routing algorithm as it computes the least
least-cost
path between source and destination by using complete and global knowledge about the
network. This algorithm takes the connectivity between the nodes and link cost as input, and this
information is obtained before actually performing any calculation. Link state algorithm is referred
to as a centralized algorithm since it is aware of the cost of each link in the network.
o Isolation algorithm: It is an algorithm that obtains the routing information by using local
information rather than gathering information from other nodes.
o as decentralized algorithm as it computes the least
Distributed algorithm: It is also known as least-cost
path between source and destination in an iterative and distributed manner. In the decentralized
algorithm, no node has the knowledge about the cost of all the network links. In the beginning, a
node contains the information only about its own directly attached links and through an iterative
process of calculation computes the least-cost path to the destination. A Distance vector
algorithm is a decentralized algorithm as it never knows the complete path from source to the
destination, instead it knows the direction through which the packet is to be forwarded along with
the least cost path.
Flooding: In case of flooding, every incoming packet is sent to all the outgoing links except the one from
it has been reached. The disadvantage of flooding is that node may contain several copies of a particular
packet.
Random walks: In case of random walks, a packet sent by the node to one of its neighbors randomly. An
advantage of using random walks is that it uses the alternative routes very efficiently.
Define Adaptive Routing algorithm is an algorithm that The Non-Adaptive Routing algorithm is an algorithm that
constructs the routing table based on the network constructs the static table to determine which node to send
conditions. the packet.
Usage Adaptive routing algorithm is used by dynamic The Non-Adaptive Routing algorithm is used by static
routing. routing.
Routing decision Routing decisions are made based on topology and Routing decisions are the static tables.
network traffic.
Categorization The types of adaptive routing algorithm, are The types of Non Adaptive routing algorithm are flooding
Centralized, isolation and distributed algorithm. and random walks.
Complexity Adaptive Routing algorithms are more complex. Non-Adaptive Routing algorithms are simple.
Transport Layer protocols
o The transport layer is represented by two protocols: TCP and UDP.
o The IP protocol in the network layer delivers a datagram from a source host to the destination
host.
o Nowadays, the operating system supports multiuser and multiprocessing environments, an
executing program is called a process. When a host sends a message to other host means that
source process is sending a process to a destination process. The transport layer
l protocols define
some connections to individual ports known as protocol ports.
o host protocol used to deliver a packet from source host to the
An IP protocol is a host-to-host
host
destination host while transport layer protocols are port-to-port
port port protocols that work on the top of
the IP protocols to deliver the packet from the originating port to the IP services, and from IP
services to the destination port.
o Each port is defined by a positive integer address, and it is of 16 bits.
UDP
o UDP stands for User Datagram
Datagr Protocol.
o UDP is a simple protocol and it provides nonsequenced transport functionality.
o UDP is a connectionless protocol.
o This type of protocol is used when reliability and security are less important than speed and size.
o UDP is an end-to-end level addresses, checksum
end transport level protocol that adds transport-level
error control, and length information to the data from the upper layer.
o The packet produced by the UDP protocol is known as a user datagram.
User Datagram Format
Where,
o Source port address: It defines the address of the application process that has delivered a
message. The source port address is of 16 bits address.
o Destination port address: It defines the address of the application process that will receive the
message. The destination port address is of a 16-bit
16 address.
o Total length: It defines the total length of the user datagram in bytes. It is a 16-bit
16 field.
o Checksum: The checksum is a 16-bit
16 tion.
field which is used in error detection.
o UDP provides basic functions needed for the end end delivery of a transmission.
end-to-end
o It does not provide any sequencing or reordering functions and does not specify the damaged
packet when reporting an error.
o ver that an error has occurred, but it does not specify which packet has been lost as
UDP can discover
it does not contain an ID or sequencing number of a particular data segment.
TCP
o TCP stands for Transmission Control Protocol.
o It provides full transport layer services tto applications.
o oriented protocol means the connection established between both the ends of
It is a connection-oriented
the transmission. For creating the connection, TCP generates a virtual circuit between sender and
receiver for the duration of a transmission.
Features
atures Of TCP protocol
o Stream data transfer: TCP protocol transfers the data in the form of contiguous stream of bytes.
TCP group the bytes in the form of TCP segments and then passed it to the IP layer for
transmission to the destination. TCP itself segments the data and forward to the IP.
o Reliability: TCP assigns a sequence number to each byte transmitted and expects a positive
acknowledgement from the receiving TCP. If ACK is not received within a timeout interval, then
the data is retransmitted to the destination.
The receiving TCP uses the sequence number to reassemble the segments if they arrive out of
order or to eliminate the duplicate segments.
o Flow Control: When receiving TCP sends an acknowledgement back to the sender indicating the
number the bytes it can receive without overflowing its internal buffer. The number of bytes is
sent in ACK in the form of the highest sequence number that it can receive without any problem.
This mechanism is also referred to as a window mechanism.
o Multiplexing: Multiplexing is a process of accepting the data from different applications and
forwarding to the different applications on different computers. At the receiving end, the data is
forwarded to the correct application. This process is known as demultiplexing. TCP transmits the
packet to the correct application by using the logical channels known as ports.
o Logical Connections: The combination of sockets, sequence numbers, and window sizes, is called
a logical connection. Each connection is identified by the pair of sockets used by sending and
receiving processes.
o Full Duplex: TCP provides Full Duplex service, i.e., the data flow in both the directions at the same
time. To achieve Full Duplex service, each TCP should have sending and receiving buffers so that
the segments can flow in both the directions. TCP is a connection-oriented protocol. Suppose the
process A wants to send and receive the data from process B. The following steps occur:
o Establish a connection between two TCPs.
o Data is exchanged in both the directions.
o The Connection is terminated.
o Source port address: It is used to define the address of the application program in a source
computer. It is a 16-bit
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
16-bit field.
o Sequence number: A stream of data is divided into two or more TCP segments. The 32-bit
32
sequence number field represents the position of the data in an original data stream.
o Acknowledgement field acknowledgement number acknowledge the data from
ement number: A 32-field
other communicating devices. If ACK field is set to 1, then it specifies the sequence number that
the receiver is expecting to receive.
o bit words. The minimum size
Header Length (HLEN): It specifies the size of the TCP header in 32-bit
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
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.
o URG: The URG field indicates that the data in a segment is urgent.
o ACK: When ACK field is set, then it validates the acknowledgement number.
o PSH: The PSH field is used to inform the sender that higher throughput is needed so if possible,
data must be pushed with higher throughput.
o RST: The reset bit is used to reset the TCP connection when there is any confusion occurs in the
sequence numbers.
o SYN: The SYN field is used to synchronize the sequence numbers in three types of segments:
connection request, connection confirmation ( with the ACK bit set ), and confirmation
acknowledgement.
o FIN: The FIN field is used to inform the receiving TCP module that the sender has finished sending
data. It is used in connection termination in three types of segments: termination request,
termination confirmation, and acknowledgement of termination confirmation.
o Window Size: The window is a 16-bit field that defines the size of the window.
o Checksum: The checksum is a 16-bit field used in error detection.
o Urgent pointer: If URG flag is set to 1, then this 16-bit field is an offset from the sequence
number indicating that it is a last urgent data byte.
o Options and padding: It defines the optional fields that convey the additional information
to the receiver.
Definition TCP establishes a virtual circuit before UDP transmits the data directly to the destination computer
transmitting the data. without verifying whether the receiver is ready to receive or
not.
acknowledgement It waits for the acknowledgement of data and It neither takes the acknowledgement, nor it retransmits the
has the ability to resend the lost packets. damaged frame.
What is IP?
Here, IP stands for internet protocol. It is a protocol defined in the TCP/IP model used for sending the
packets from source to destination. The main task of IP is to deliver the packets from source to the
destination based on the IP addresses available in the packet headers. IP defines the packet structure that
hides the data which is to be delivered as well as the addressing method that labels the datagram with a
source and destination information.
An IP protocol provides the connectionless service, which is accompanied by two transport protocols,
i.e., TCP/IP and UDP/IP, so internet protocol is also known as TCP/IP or UDP/IP.
The first version of IP (Internet Protocol) was IPv4. After IPv4, IPv6 came into the market, which has been
increasingly used on the public internet since 2006.
The development of the protocol gets started in 1974 by Bob Kahn and Vint Cerf. It is used in conjunction
with the Transmission Control Protocol (TCP), so they together named the TCP/IP.
The first major version of the internet protocol was IPv4, which was version 4. This protocol was officially
declared in RFC 791 by the Internet Engineering Task Force (IETF) in 1981.
After IPv4, the second major version of the internet protocol was IPv6, which was version 6. It was officially
declared by the IETF in 1998. The main reason behind the development of IPv6 was to replace IPv4. There
is a big difference between IPv4 and IPv6 is that IPv4 uses 32 bits for addressing, while IPv6 uses 128 bits
for addressing.
Function
The main function of the internet protocol is to provide addressing to the hosts, encapsulating the data
into a packet structure, and routing the data from source to the destination across one or
more IP networks. In order to achieve these functionalities, internet protocol provides two major things
which are given below.
o Format of IP packet
o IP Addressing system
What is an IP packet?
Before an IP packet is sent over the network, two major components are added in an IP packet,
i.e., header and a payload.
An IP header contains lots of information about the IP packet which includes:
o Source IP address: The source is the one who is sending the data.
o Destination IP address: The destination is a host that receives the data from the sender.
o Header length
o Packet length
o TTL (Time to Live): The number of hops occurs before the packet gets discarded.
o Transport protocol: The transport protocol used by the internet protocol, either it can be TCP or
UDP.
There is a total of 14 fields exist in the IP header, and one of them is optional.
IP routing is a process of determining the path for data so that it can travel from the source to the
estination. As we know that the data is divided into multiple packets, and each packet will pass through
destination.
a web of the router until it reaches the final destination. The path that the data packet follows is
algorithm considers various factors like the size of the
determined by the routing algorithm. The routing algorithm
packet and its header to determine the efficient route for the data from the source to the destination.
When the data packet reaches some router, then the source address and destination address are used us
with a routing table to determine the next hop's address. This process goes on until it reaches the
destination. The data is divided into multiple packets so all the packets will travel individually to reach the
destination.
For example, when an email is sent from the email server, then the TCP layer in this email server divides
the data into multiple packets, provides numbering to these packets and transmits them to the IP layer.
This IP layer further transmits the packet to the destination email server. On the side of the destination
server, the IP layer transmits these data packets to the TCP layer, and the TCP layer recombines these data
packets into the message. The message is sent to the email application.
What is IP Addressing?
An IP address is a unique identifier assigned to the computer which is connected to the internet. Each IP
address consists of a series of characters like 192.168.1.2. Users cannot access the domain name of each
website with the help of these characters, so DNS resolvers are used that convert the human-readable
domain names into a series of characters. Each IP packet contains two addresses, i.e., the IP address of the
device, which is sending the packet, and the IP address of the device which is receiving the packet.
Types of IP addresses
o Public address
o Private address
Public address
The public address is also known as an external address as they are grouped under the WAN addresses.
We can also define the public address as a way to communicate outside the network. This address is used
to access the internet. The public address available on our computer provides the remote access to our
computer. With the help of a public address, we can set up the home server to access the internet. This
address is generally assigned by the ISP (Internet Service Provider).
o The scope of the public address is global, which means that we can communicate outside the
network.
o This address is assigned by the ISP (Internet Service Provider).
o It is not available at free of cost.
o We can get the Public IP by typing on Google "What is my IP".
Private address
A private address is also known as an internal address, as it is grouped under the LAN addresses. It is used
to communicate within the network. These addresses are not routed on the internet so that no traffic can
come from the internet to this private address. The address space for the private address is allocated
using InterNIC to create our own network. The private addresses are assigned to mainly those computers,
printers, smartphones, which are kept inside the home or the computers that are kept within the
organization. For example, a private address is assigned to the printer, which is kept inside our home, so
that our family member can take out the print from the printer.
If the computer is assigned with a private address, then the devices available within the local network can
view the computer through the private ip address. However, the devices available outside the local
network cannot view the computer through the private IP address, but they can access the computer if
they know the router's public address. To access the computer directly, NAT (Network Address Translator)
is to be used.
IPv4 vs IPv6
What is IP?
An IP stands for internet protocol. An IP address is assigned to each device connected to a network. Each
device uses an IP address for communication. It also behaves as an identifier as this address is used to
identify the device on a network. It defines the technical format of the packets. Mainly, both the networks,
i.e., IP and TCP, are combined together, so together, they are referred to as a TCP/IP. It creates a virtual
connection between the source and the destination.
We can also define an IP address as a numeric address assigned to each device on a network. An IP
address is assigned to each device so that the device on a network can be identified uniquely. To facilitate
the routing of packets, TCP/IP protocol uses a 32-bit logical address known as IPv4(Internet Protocol
version 4).
An IP address consists of two parts, i.e., the first one is a network address, and the other one is a host
address.
o IPv4
o IPv6
What is IPv4?
IPv4 is a version 4 of IP. It is a current version and the most commonly used IP address. It is a 32-bit
address written in four numbers separated by 'dot', i.e., periods. This address is unique for each device.
The above example represents the IP address in which each group of numbers separated by periods is
called an Octet. Each number in an octet is in the range from 0-255. This address can produce
4,294,967,296 possible unique addresses.
In today's computer network world, computers do not understand the IP addresses in the standard
numeric format as the computers understand the numbers in binary form only. The binary number can be
either 1 or 0. The IPv4 consists of four sets, and these sets represent the octet. The bits in each octet
represent a number.
Each bit in an octet can be either 1 or 0. If the bit the 1, then the number it represents will count, and if
the bit is 0, then the number it represents does not count.
Now, we will see how to obtain the binary representation of the above IP address, i.e., 66.94.29.13
To obtain 66, we put 1 under 64 and 2 as the sum of 64 and 2 is equal to 66 (64+2=66), and the
remaining bits will be zero, as shown above. Therefore, the binary bit version of 66 is 01000010.
To obtain 29, we put 1 under 16, 8, 4, and 1 as the sum of these numbers is equal to 29, and the
remaining bits will be zero. Therefore, the binary bit version of 29 is 00011101.
To obtain 13, we put 1 under 8, 4, and 1 as the sum of these numbers is equal to 13, and the remaining
bits will be zero. Therefore, the binary bit version of 13 is 00001101.
Drawback of IPv4
Currently, the population of the world is 7.6 billion. Every user is having more than one device connected
with the internet, and private companies also rely on the internet. As we know that IPv4 produces 4 billion
addresses, which are not enough for each device connected to the internet on a planet. Although the
various techniques were invented, such as variable- length mask, network address translation, port
address translation, classes, inter-domain translation, to conserve the bandwidth of IP address and slow
down the depletion of an IP address. In these techniques, public IP is converted into a private IP due to
which the user having public IP can also use the internet. But still, this was not so efficient, so it gave rise
to the development of the next generation of IP addresses, i.e., IPv6.
What is IPv6?
IPv4 produces 4 billion addresses, and the developers think that these addresses are enough, but they
were wrong. IPv6 is the next generation of IP addresses. The main difference between IPv4 and IPv6 is the
address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal address.
IPv6 provides a large address space, and it contains a simple header as compared to IPv4.
It provides transition strategies that convert IPv4 into IPv6, and these strategies are as follows:
o Dual stacking: It allows us to have both the versions, i.e., IPv4 and IPv6, on the same device.
o Tunneling: In this approach, all the users have IPv6 communicates with an IPv4 network to reach
IPv6.
o Network Address Translation: The translation allows the communication between the hosts having
a different version of IP.
This hexadecimal address contains both numbers and alphabets. Due to the usage of both the numbers
38
and alphabets, IPv6 is capable of producing over 340 undecillion (3.4*10 ) addresses.
IPv6 is a 128-bit hexadecimal address made up of 8 sets of 16 bits each, and these 8 sets are separated by
a colon. In IPv6, each hexadecimal character represents 4 bits. So, we need to convert 4 bits to a
hexadecimal number at a time
Address format
The above diagram shows the address format of IPv4 and IPv6. An IPv4 is a 32-bit decimal address. It
contains 4 octets or fields separated by 'dot', and each field is 8-bit in size. The number that each field
contains should be in the range of 0-255. Whereas an IPv6 is a 128-bit hexadecimal address. It contains 8
fields separated by a colon, and each field is 16-bit in size.
Fields IPv4 is a numeric address that consists of 4 fields which IPv6 is an alphanumeric address that consists of
are separated by dot (.). 8 fields, which are separated by colon.
Classes IPv4 has 5 different classes of IP address that includes IPv6 does not contain classes of IP addresses.
Class A, Class B, Class C, Class D, and Class E.
Number of IP IPv4 has a limited number of IP addresses. IPv6 has a large number of IP addresses.
address
VLSM It supports VLSM (Virtual Length Subnet Mask). Here, It does not support VLSM.
VLSM means that Ipv4 converts IP addresses into a
subnet of different sizes.
Address It supports manual and DHCP configuration. It supports manual, DHCP, auto-configuration,
configuration and renumbering.
Address space It generates 4 billion unique addresses It generates 340 undecillion unique addresses.
End-to-end In IPv4, end-to-end connection integrity is unachievable. In the case of IPv6, end-to-end connection
connection integrity integrity is achievable.
Security features In IPv4, security depends on the application. This IP In IPv6, IPSEC is developed for security
address is not developed in keeping the security feature purposes.
in mind.
Address In IPv4, the IP address is represented in decimal. In IPv6, the representation of the IP address in
representation hexadecimal.
Fragmentation Fragmentation is done by the senders and the forwarding Fragmentation is done by the senders only.
routers.
Packet flow It does not provide any mechanism for packet flow It uses flow label field in the header for the
identification identification. packet flow identification.
Checksum field The checksum field is available in IPv4. The checksum field is not available in IPv6.
Transmission scheme IPv4 is broadcasting. On the other hand, IPv6 is multicasting, which
provides efficient network operations.
Encryption and It does not provide encryption and authentication. It provides encryption and authentication.
Authentication
Number of octets It consists of 4 octets. It consists of 8 fields, and each field contains 2
octets. Therefore, the total number of octets in
IPv6 is 16.