Professional Documents
Culture Documents
Unit Iii
Unit Iii
Unit Iii
Unit-III
1. Packetizing –
The process of encapsulating the data received from upper layers of
the network(also called as payload) in a network layer packet at the
source and decapsulating the payload from the network layer packet
at the destination is known as packetizing.
The source host adds a header that contains the source and destination
address and some other relevant information required by the network
layer protocol to the payload received from the upper layer protocol,
and delivers the packet to the data link layer.
The destination host receives the network layer packet from its data
link layer, decapsulates the packet, and delivers the payload to the
corresponding upper layer protocol. The routers in the path are not
allowed to change either the source or the destination address. The
routers in the path are not allowed to decapsulate the packets they
receive unless they need to be fragmented.
Switching techniques
In large networks, there can be multiple paths from sender to receiver.
The switching technique will decide the best route for data transmission.
Switching technique is used to connect the systems for making one-to-
one communication.
Circuit Switching
o Circuit switching is a switching technique that establishes a
dedicated path between sender and receiver.
o In the Circuit Switching Technique, once the connection is
established then the dedicated path will remain to exist until the
connection is terminated.
o Circuit switching in a network operates in a similar way as the
telephone works.
o A complete end-to-end path must exist before the communication
takes place.
o In case of circuit switching technique, when any user wants to send
the data, voice, video, a request signal is sent to the receiver then
the receiver sends back the acknowledgment to ensure the
availability of the dedicated path. After receiving the
acknowledgment, dedicated path transfers the data.
o Circuit switching is used in public telephone network. It is used for
voice transmission.
o Fixed data can be transferred at a time in circuit switching
technology.
o Circuit establishment
o Data transfer
o Circuit Disconnect
o Crossbar Switch
o Multistage Switch
Crossbar Switch
The Crossbar switch is a switch that has n input lines and n output lines.
The crossbar switch has n2 intersection points known as crosspoints.
Multistage Switch
o Multistage Switch is made by splitting the crossbar switch into the
smaller units and then interconnecting them.
o It reduces the number of crosspoints.
o Once the dedicated path is established, the only delay occurs in the
speed of data transmission.
o It takes a long time to establish a connection approx 10 seconds
during which no data can be transmitted.
o It is more expensive than other switching techniques as a dedicated
path is required for each connection.
o It is inefficient to use because once the path is established and no
data is transferred, then the capacity of the path is wasted.
o In this case, the connection is dedicated therefore no other data can
be transferred even if the channel is free.
Message Switching
o Message Switching is a switching technique in which a message is
transferred as a complete unit and routed through intermediate
nodes at which it is stored and forwarded.
o In Message Switching technique, there is no establishment of a
dedicated path between the sender and receiver.
o The destination address is appended to the message. Message
Switching provides a dynamic routing as the message is routed
through the intermediate nodes based on the information available
in the message.
o Message switches are programmed in such a way so that they can
provide the most efficient routes.
o Each and every node stores the entire message and then forward it
to the next node. This type of network is known as store and
forward network.
o Message switching treats each message as an independent entity.
Packet Switching
o The packet switching is a switching technique in which the
message is sent in one go, but it is divided into smaller pieces, and
they are sent individually.
o The message splits into smaller pieces known as packets and
packets are given a unique number to identify their order at the
receiving end.
o Every packet contains some information in its headers such as
source address, destination address and sequence number.
o Packets will travel across the network, taking the shortest path as
possible.
o All the packets are reassembled at the receiving end in correct
order.
o If any packet is missing or corrupted, then the message will be sent
to resend the message.
o If the correct order of the packets is reached, then the
acknowledgment message will be sent.
Logical addressing
IPV4 addresses
The IPv4 addresses are universal in the sense that the addressing system
must be accepted by any host that wants to be connected to the Internet.
That means global addressing.
Address Space
IPv4 has a certain address space. An address space is the total number of
addresses used by the protocol. If a protocol uses N bits to define an
address, the address space is 2N
IPv4 uses 32-bit address format, which means that the address space is
232 or 4,294,967,296
Notations
1. Binary notation
2. Dotted decimal notation
1) Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. Each octet
is often referred to as a byte. So it is common to hear an IPv4
address referred to a 4-byte address. The following is an example of
an IPv4 address in binary notation: 01110111 10010101 00000001
00000011
2) Dotted-Decimal Notation
IPV4 addresses are usually written in decimal form with a decimal
point (dot) separating the bytes since it’s more compatible. The
following is an example: 119.149.1.3 (above one and this one is same
just different notation)
IPV6 addresses
Operating systems (OSes) like Windows 10, macOS and Ubuntu support
IPv6. Currently, the use of address types is mixed. Devices in use now
will either use IPv6 or IPv4. Domain name systems (DNSes) have
supported IPv6 since 2008.
It has been a concern for some time that the IPv4 addressing scheme was
running out of potential addresses. The IPv6 format was created to
enable the trillions of new IP addresses to connect an ever-greater
number of computing devices and the rapidly expanding numbers of
items with embedded connectivity, thanks to the internet of things (IoT).
The number of potential IPv6 addresses has been calculated to be over
340 undecillion (or 340 trillion trillion trillion). According to Computer
History Museum docent Dick Guertin, that number allows an IPv6
address for each atom on the surface of the planet, with enough left over
for more than 100 more similar planets.
FE80:CD00:0000:0CDE:1257:0000:211E:729C
The network node can be split even further into a block of 48 bits and a
block of 16 bits. The upper 48-bit section is used for global network
addresses. The lower 16-bit section is controlled by network
administrators and is used for subnets on an internal network.
FE80:CD00:0:CDE:1257:0:211E:729C
The specific layout of an IPv6 address may vary somewhat, depending
on its format. Three basic parts that make up the address are the routing
prefix, the subnet ID and the interface ID.
Both the routing prefix and the subnet ID represent two main levels in
which the address is constructed -- either global or site-specific. The
routing prefix is the number of bits that can be subdivided -- typically,
decided by Internet Registries and Internet Service Providers (ISPs). If
you were to look at an IPv6 address, the leftmost set of numbers -- the
first 48 bits -- is called the site prefix. The subnet ID is the next 16 bits.
The subnet ID lays out site topology. The last 64-bits are called the
interface ID, which can be automatically or manually configured.
Global unicast. These addresses are routable on the internet and start
with "2001:" as the prefix group. Global unicast addresses are the
equivalent of IPv4 public addresses.
Unicast address. Used to identify the interface of an individual node.
Anycast address. Used to identify a group of interfaces on different
nodes.
Multicast address. An address used to define multicast Multicasts
are used to send a single packet to multiple destinations at one time.
Link local addresses. One of the two internal address types that are
not routed on the internet. Link local addresses are used inside an
internal network, are self-assigned and start with "fe80:" as the prefix
group.
Unique local addresses. This is the other type of internal address that
is not routed on the internet. Unique local addresses are equivalent to
the IPv4 addresses 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
Difference between IPv4 and IPv6
IPv4 IPv6
IPv4 has a 32-bit address length IPv6 has a 128-bit address length
IPv6 packet may contain zero, one or more extension headers but these
should be present in their recommended order:
Rule: Hop-by-Hop options header(if present) should always be placed
after the IPv6 base header.
Conventions :
1. Any extension header can appear at most once except Destination
Header because Destination Header is present two times in the above
list itself.
2. If Destination Header is present before Routing Header then it will
be examined by all intermediate nodes specified in the routing
header.
3. If Destination Header is present just above the Upper layer then it
will be examined only by the Destination node.
Given order in which all extension header should be chained in IPv6
packet and working of each extension header :
Generally, the border router is configured for NAT i.e the router which
has one interface in the local (inside) network and one interface in the
global (outside) network. When a packet traverse outside the local
(inside) network, then NAT converts that local (private) IP address to a
global (public) IP address. When a packet enters the local network, the
global (public) IP address is converted to a local (private) IP address.
If NAT runs out of addresses, i.e., no address is left in the pool
configured then the packets will be dropped and an Internet Control
Message Protocol (ICMP) host unreachable packet to the destination is
sent.
Why mask port numbers ?
Outside global address – This is the outside host as seen from the
outside network. It is the IP address of the outside destination host
before translation.
Advantages of NAT –
NAT conserves legally registered IP addresses.
Disadvantage of NAT –
Also, the router being a network layer device, should not tamper with
port numbers(transport layer) but it has to do so because of NAT.
Subnetting
When we Subnet a network, we basically split it into smaller networks.
For example, when a set of IP Addresses is given to a company, e.g 254
they might want to "break" (the correct term is "partition") that one
network into smaller ones, one for each department. This way, their
Technical department and Management department can each have a
small network of their own. By subnetting the network we can partition
it to as many smaller networks as we need and this also helps reduce
traffic and hides the complexity of the network.
By default, all type of Classes (A, B and C) have a subnet mask, we call
it the "Default Subnet mask". You need to have one because:
1) All computers need the subnet mask field filled when configuring IP
2) You need to set some logical boundaries in your network
3) You should at least enter the default subnet mask for the Class you're
using
The table below shows clearly the subnet mask that applies for each
network Class.
When dealing with subnet masks in the real world, we are free in most
cases to use any type of subnet mask in order to meet our needs. If for
example we require one network which can contain up to 254
computers, then a Class C network with its default subnet mask will do
fine, but if we need more, then we might consider a Class B network
with its default subnet mask.
Note that the default subnet masks have been set by the IEEE
committee, the same guys that set and approve the different standards
and protocols.
In reality, we have just created 8 networks from the one large (blue)
network we had, but I am keeping things simple for now and showing
only 2 of these smaller networks because I want you to understand the
concept of subnetting and see how important the subnet mask is.
Internetworking
In real world scenario, networks under same administration are
generally scattered geographically. There may exist requirement of
connecting two different networks of same kind as well as of different
kinds. Routing between two networks is called internetworking.
Networks can be considered different based on various parameters such
as, Protocol, topology, Layer-2 network and addressing scheme.
In internetworking, routers have knowledge of each other’s address and
addresses beyond them. They can be statically configured go on
different network or they can learn by using internetworking routing
protocol.
When the data enters from one end of Tunnel, it is tagged. This tagged
data is then routed inside the intermediate or transit network to reach
the other end of Tunnel. When data exists the Tunnel its tag is removed
and delivered to the other part of the network.
Both ends seem as if they are directly connected and tagging makes
data travel through transit network without any modifications.
Packet Fragmentation
Most Ethernet segments have their maximum transmission unit (MTU)
fixed to 1500 bytes. A data packet can have more or less packet length
depending upon the application. Devices in the transit path also have
their hardware and software capabilities which tell what amount of data
that device can handle and what size of packet it can process.
If the data packet size is less than or equal to the size of packet the
transit network can handle, it is processed neutrally. If the packet is
larger, it is broken into smaller pieces and then forwarded. This is called
packet fragmentation. Each fragment contains the same destination and
source address and routed through transit path easily. At the receiving
end it is assembled again.
If a packet with DF (don’t fragment) bit set to 1 comes to a router
which can not handle the packet because of its length, the packet is
dropped.
When a packet is received by a router has its MF (more fragments) bit
set to 1, the router then knows that it is a fragmented packet and parts of
the original packet is on the way.
If packet is fragmented too small, the overhead is increases. If the
packet is fragmented too large, intermediate router may not be able to
process it and it might get dropped.
What is Congestion Control Algorithm?
Congestion causes choking of the communication medium. When too
many packets are displayed in a method of the subnet, the subnet's
performance degrades. Hence, a network's communication channel is
called congested if packets are traversing the path and experience delays
mainly over the path's propagation delay.
There is two congestion control algorithm which is as follows:
Leaky Bucket
The leaky bucket algorithm discovers its use in the context of network
traffic shaping or rate-limiting. The algorithm allows controlling the rate
at which a record is injected into a network and managing burstiness in
the data rate.
A leaky bucket execution and a token bucket execution are
predominantly used for traffic shaping algorithms. This algorithm is
used to control the rate at which traffic is sent to the network and shape
the burst traffic to a steady traffic stream.
The figure shows the leaky bucket algorithm.
In this algorithm, a bucket with a volume of, say, b bytes and a hole in
the Notes bottom is considered. If the bucket is null, it means b bytes are
available as storage. A packet with a size smaller than b bytes arrives at
the bucket and will forward it. If the packet's size increases by more than
b bytes, it will either be discarded or queued. It is also considered that
the bucket leaks through the hole in its bottom at a constant rate of r
bytes per second.
The outflow is considered constant when there is any packet in the
bucket and zero when it is empty. This defines that if data flows into the
bucket faster than data flows out through the hole, the bucket overflows.
The disadvantages compared with the leaky-bucket algorithm are the
inefficient use of available network resources. The leak rate is a fixed
parameter. In the case of the traffic, volume is deficient, the large area of
network resources such as bandwidth is not being used effectively. The
leaky-bucket algorithm does not allow individual flows to burst up to
port speed to effectively consume network resources when there would
not be resource contention in the network.
Token Bucket Algorithm
The leaky bucket algorithm has a rigid output design at the average rate
independent of the bursty traffic. In some applications, when large bursts
arrive, the output is allowed to speed up. This calls for a more flexible
algorithm, preferably one that never loses information. Therefore, a
token bucket algorithm finds its uses in network traffic shaping or rate-
limiting.
It is a control algorithm that indicates when traffic should be sent. This
order comes based on the display of tokens in the bucket. The bucket
contains tokens. Each of the tokens defines a packet of predetermined
size. Tokens in the bucket are deleted for the ability to share a packet.
When tokens are shown, a flow to transmit traffic appears in the display
of tokens. No token means no flow sends its packets. Hence, a flow
transfers traffic up to its peak burst rate in good tokens in the bucket.
Thus, the token bucket algorithm adds a token to the bucket each 1 / r
seconds. The volume of the bucket is b tokens. When a token appears,
and the bucket is complete, the token is discarded. If a packet of n bytes
appears and n tokens are deleted from the bucket, the packet is
forwarded to the network.
When a packet of n bytes appears but fewer than n tokens are available.
No tokens are removed from the bucket in such a case, and the packet is
considered non-conformant. The non-conformant packets can either be
dropped or queued for subsequent transmission when sufficient tokens
have accumulated in the bucket.
They can also be transmitted but marked as being non-conformant. The
possibility is that they may be dropped subsequently if the network is
overloaded.
Address Resolution Protocol
Address Resolution Protocol (ARP) is a communication protocol that
works on the TCP/IP Layer 2.
Each node uses Dijkstra's algorithm on the graph to calculate the optimal
routes to all nodes.
Algorithm
Initialization
N = {A} // A is a root node.
for all nodes v
if v adjacent to A
then D(v) = c(A,v)
else D(v) = infinity
loop
find w not in N such that D(w) is a minimum.
Add w to N
Update D(v) for all v adjacent to w and not in N:
D(v) = min(D(v) , D(w) + c(w,v))
Until all nodes in N
35.7M
645
Prime Ministers of India | List of Prime Minister of India (1947-2020)
Step 1:
The first step is an initialization step. The currently known least cost
path from A to its directly attached neighbors, B, C, D are 2,5,1
respectively. The cost from A to B is set to 2, from A to D is set to 1 and
from A to C is set to 5. The cost from A to E and F are set to infinity as
they are not directly linked to A.
Step 2:
In the above table, we observe that vertex D contains the least cost path
in step 1. Therefore, it is added in N. Now, we need to determine a least-
cost path through D vertex.
1. v = B, w = D
2. D(B) = min( D(B) , D(D) + c(D,B) )
3. = min( 2, 1+2)>
4. = min( 2, 3)
5. The minimum value is 2. Therefore, the currently shortest path from A t
o B is 2.
1. v = C, w = D
2. D(B) = min( D(C) , D(D) + c(D,C) )
3. = min( 5, 1+3)
4. = min( 5, 4)
5. The minimum value is 4. Therefore, the currently shortest path from A t
o C is 4.</p>
Step 3:
In the above table, we observe that both E and B have the least cost path
in step 2. Let's consider the E vertex. Now, we determine the least cost
path of remaining vertices through E.
1. v = B, w = E
2. D(B) = min( D(B) , D(E) + c(E,B) )
3. = min( 2 , 2+ ∞ )
4. = min( 2, ∞)
5. The minimum value is 2. Therefore, the currently shortest path from A t
o B is 2.
1. v = C, w = E
2. D(B) = min( D(C) , D(E) + c(E,C) )
3. = min( 4 , 2+1 )
4. = min( 4,3)
5. The minimum value is 3. Therefore, the currently shortest path from A t
o C is 3.
1. v = F, w = E
2. D(B) = min( D(F) , D(E) + c(E,F) )
3. = min( ∞ , 2+2 )
4. = min(∞ ,4)
5. The minimum value is 4. Therefore, the currently shortest path from A t
o F is 4.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
Step 4:
In the above table, we observe that B vertex has the least cost path in
step 3. Therefore, it is added in N. Now, we determine the least cost path
of remaining vertices through B.
1. v = C, w = B
2. D(B) = min( D(C) , D(B) + c(B,C) )
3. = min( 3 , 2+3 )
4. = min( 3,5)
5. The minimum value is 3. Therefore, the currently shortest path from A t
o C is 3.
b) Calculating the shortest path from A to F.
1. v = F, w = B
2. D(B) = min( D(F) , D(B) + c(B,F) )
3. = min( 4, ∞)
4. = min(4, ∞)
5. The minimum value is 4. Therefore, the currently shortest path from A t
o F is 4.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
Step 5:
In the above table, we observe that C vertex has the least cost path in
step 4. Therefore, it is added in N. Now, we determine the least cost path
of remaining vertices through C.
1. v = F, w = C
2. D(B) = min( D(F) , D(C) + c(C,F) )
3. = min( 4, 3+5)
4. = min(4,8)
5. The minimum value is 4. Therefore, the currently shortest path from A t
o F is 4.
Step N D(B),P( D(C),P(C) D(D),P(D D(E),P(E D(F),P(F
B) ) ) )
5 ADEB 4,E
C
5 ADEBC 4,E
6 ADEBCF
Final table:
Disadvantage: