CN Module 3
CN Module 3
Network layer
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 establishment
o Data transfer
o Circuit Disconnect
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 If one path fails, then there will be an availability of another path.
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 Data channels are shared among the communicating devices that improve the efficiency
of using available bandwidth.
o Traffic congestion can be reduced because the message is temporarily stored in the nodes.
o Message priority can be used to manage the network.
o The size of the message which is sent over the network can be varied. Therefore, it
supports the data of unlimited size.
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.
Node takes routing decisions to forward the Node does not take any routing decision.
packets.
Congestion cannot occur as all the packets Congestion can occur when the node is busy, and it does no
travel in different directions. allow other packets to pass through.
It is more flexible as all the packets are treated It is not very flexible.
as an independent entity.
o Packet Switching technique cannot be implemented in those applications that require low
delay and high-quality services.
o The protocols used in a packet switching technique are very complex and requires high
implementation cost.
o If the network is overloaded or corrupted, then it requires retransmission of lost packets.
It can also lead to the loss of critical information if errors are nor recovered.
IPAddress :
An Internet Protocol address is an IP address. It is a unique address that identifies the device
on the network. The Internet Service Provider (ISP) assigns IP addresses to all devices on its
network. IP addresses are not generated at random. The Internet Assigned Numbers Authority
(IANA), a part of the Internet Corporation for Assigned Names and Numbers (ICANN),
generates and assigns them mathematically . IP addresses are used at the network layer. IP
Addresses are routable in nature.
IPVersionTypes :
There are 2 different versions of IP as follows.
1. IPv4(IPversion4) –
IPv4 employs a 32-bit address. It is composed of four numbers separated by a ‘dot’ i.e.,
periods called an octet (byte). Each number in the octet can range from 0 to 255.
Example – 172.166.3.28
2. IPv6(IPversion6) –
IPv6 is the next generation of Internet Protocol addresses. In comparison to IPV4, IPv6 has
a larger address space. IPv6 has a length of 128 bits and is written in hexadecimal. It is
composed of eight fields, each of which contains two octets. As a result, IPv6 has 16 octets
in total.
Example – 3221:1cd7:74b6:6da7:0000:0000:7349:6472
MACAddress :
A MAC address is a one-of-a-kind identification assigned to a NIC (Network Interface
Controller/Card). The full form of MAC address is Media Access Control address. MAC
addresses are 48 bits long and these addresses could not be routed between networks. MAC
Address is a 12 digit hexadecimal numeral which is most typically expressed with a colon or
hyphen separating every two digits (an octet), making reading easier. MAC Addresses are used
at the Data Link Layer.
Network Addressing
o In the above figure, a router has three interfaces labeled as 1, 2 & 3 and each router
interface contains its own IP address.
o Each host contains its own interface and IP address.
o All the interfaces attached to the LAN 1 is having an IP address in the form of
223.1.1.xxx, and the interfaces attached to the LAN 2 and LAN 3 have an IP address in
the form of 223.1.2.xxx and 223.1.3.xxx respectively.
o Each IP address consists of two parts. The first part (first three bytes in IP address)
specifies the network and second part (last byte of an IP address) specifies the host in the
network.
Classful Addressing
o Class A
o Class B
o Class C
o Class D
o Class E
Class A
In Class A, an IP address is assigned to those networks that contain a large number of hosts.
In Class A, the first bit in higher order bits of the first octet is always set to 0 and the remaining 7
bits determine the network ID. The 24 bits determine the host ID in any network.
Class B
In Class B, an IP address is assigned to those networks that range from small-sized to large-sized
networks.
In Class B, the higher order bits of the first octet is always set to 10, and the remaining14 bits
determine the network ID. The other 16 bits determine the Host ID.
Class C
In Class C, an IP address is assigned to only small-sized networks.
In Class C, the higher order bits of the first octet is always set to 110, and the remaining 21 bits
determine the network ID. The 8 bits of the host ID determine the host in a network.
Class D
In Class D, an IP address is reserved for multicast addresses. It does not possess subnetting. The
higher order bits of the first octet is always set to 1110, and the remaining bits determines the
host ID in any network.
Class E
In Class E, an IP address is used for the future use or for the research and development purposes.
It does not possess any subnetting. The higher order bits of the first octet is always set to 1111,
and the remaining bits determines the host ID in any network.
The Host ID is used to determine the host within any network. The Host ID is assigned based on
the following rules:
o The Host ID must be unique within any network.
o The Host ID in which all the bits are set to 0 cannot be assigned as it is used to represent
the network ID of the IP address.
o The Host ID in which all the bits are set to 1 cannot be assigned as it is reserved for the
multicast address.
If the hosts are located within the same local network, then they are assigned with the same
network ID. The following are the rules for assigning Network ID:
What is IP?
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 and alphabets, IPv6 is capable of producing over 340 undecillion (3.4*1038) 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.
Differences between IPv4 and IPv6
Ipv4 Ipv6
Classes IPv4 has 5 different classes of IP address that IPv6 does not contain classes of I
includes Class A, Class B, Class C, Class D, addresses.
and Class E.
Number of IP address IPv4 has a limited number of IP addresses. IPv6 has a large number of I
addresses.
VLSM It supports VLSM (Virtual Length Subnet It does not support VLSM.
Mask). Here, VLSM means that Ipv4 converts
IP addresses into a subnet of different sizes.
Address configuration It supports manual and DHCP configuration. It supports manual, DHCP, auto
configuration, and renumbering.
Address space It generates 4 billion unique addresses It generates 340 undecillion uniqu
addresses.
End-to-end connection In IPv4, end-to-end connection integrity is In the case of IPv6, end-to-en
integrity unachievable. connection integrity is achievable.
Security features In IPv4, security depends on the application. In IPv6, IPSEC is developed fo
This IP address is not developed in keeping the security purposes.
security feature in mind.
Address representation In IPv4, the IP address is represented in In IPv6, the representation of the I
decimal. address in hexadecimal.
Fragmentation Fragmentation is done by the senders and the Fragmentation is done by the sende
forwarding routers. only.
Packet flow It does not provide any mechanism for packet It uses flow label field in the header fo
identification flow identification. the packet flow identification.
Checksum field The checksum field is available in IPv4. The checksum field is not available i
IPv6.
Address Mapping
Address mapping is a process of determining a logical address knowing the physical address of
the device and determining the physical address by knowing the logical address of the device.
Address mapping is required when a packet is routed from source host to destination host in the
same or different network.
Static mapping: In static mapping, it creates a table that contains a logical address with a
physical address.
Dynamic mapping: When a machine knows one of two addresses (logical or physical) through
dynamic mapping, it may use this protocol to find the other one address. There are designed two
protocols for done dynamic mapping.
Address Resolution Protocol (ARP)
Reverse Address Resolution Protocol (RARP)
Address Resolution Protocol (ARP
Address Resolution Protocol (ARP) is a communication protocol used to find the MAC (Media
Access Control) address of a device from its IP address. This protocol is used when a device
wants to communicate with another device on a Local Area Network or Ethernet.
Types of ARP
There are four types of Address Resolution Protocol, which is given below:
o Proxy ARP
o Gratuitous ARP
o Inverse ARP
Proxy ARP - Proxy ARP is a method through which a Layer 3 devices may respond to ARP
requests for a target that is in a different network from the sender. The Proxy ARP
configured router responds to the ARP and map the MAC address of the router with the target IP
At the backend, the proxy router sends its packets to the appropriate destination because the
packets contain the necessary information.
of the host that helps to identify the duplicate IP address. It is a broadcast request for the IP
address of the router. If an ARP request is sent by a switch or router to get its IP address and no
ARP responses are received, so all other nodes cannot use the IP address allocated to that switch
or router. Yet if a router or switch sends an ARP request for its IP address and receives an ARP
response, another node uses the IP address allocated to the switch or router.
There are some primary use cases of gratuitous ARP that are given below:
o The gratuitous ARP is used to update the ARP table of other devices.
o It also checks whether the host is using the original IP address or a duplicate one.
o Reverse ARP (RARP) - It is a networking protocol used by the client system in a local
area network (LAN) to request its IPv4 address from the ARP gateway router table. A
table is created by the network administrator in the gateway-router that is used to find out
the MAC address to the corresponding IP address.
o When a new system is set up or any machine that has no memory to store the IP address,
then the user has to find the IP address of the device. The device sends a RARP broadcast
packet, including its own MAC address in the address field of both the sender and the
receiver hardware. A host installed inside of the local network called the RARP-server is
prepared to respond to such type of broadcast packet. The RARP server is then trying to
locate a mapping table entry in the IP to MAC address. If any entry matches the item in
the table, then the RARP server sends the response packet along with the IP address to
the requesting computer.
ImportantFeaturesofBootstrapProtocol :
Here, we will discuss the features of Bootstrap Protocol as follows.
o Bootstrap Protocol (BOOTP) is a basic protocol that automatically provides each
participant in a network connection with a unique IP address for identification and
authentication as soon as it connects to the network. This helps the server to speed up
data transfers and connection requests.
o BOOTP uses a unique IP address algorithm to provide each system on the network
with a completely different IP address in a fraction of a second.
o This shortens the connection time between the server and the client. It starts the
process of downloading and updating the source code even with very little
information.
DHCP can be implemented on local networks as well as large enterprise networks. DHCP is the
default protocol used by the most routers and networking equipment. DHCP is also called RFC
(Request for comments) 2131.
DHCP does the following:
o DHCP manages the provision of all the nodes or devices added or dropped from the
network.
o DHCP maintains the unique IP address of the host using a DHCP server.
DHCP is also used to configure the proper subnet mask, default gateway and DNS server
information on the node or device.
There are many versions of DCHP are available for use in IPV4 (Internet Protocol Version 4)
and IPV6 (Internet Protocol Version 6).
DHCP runs at the application layer of the TCP/IP protocol stack to dynamically assign IP
addresses to DHCP clients/nodes and to allocate TCP/IP configuration information to the DHCP
clients. Information includes subnet mask information, default gateway, IP addresses and domain
name system addresses.
DHCP is based on client-server protocol in which servers manage a pool of unique IP addresses,
as well as information about client configuration parameters, and assign addresses out of those
address pools.
FORWARDING
Forwarding means to place the packet in its route to its destination. Forwarding Forwarding
requires a host or a router to have a routing table. When a host has a packet to send or when a
router has received received a packet to be forwarded.
unicast routing
Most of the traffic on the internet and intranets known as unicast data or unicast traffic is sent
with specified destination. Routing unicast data over the internet is called unicast routing. It is
the simplest form of routing because the destination is already known. Hence the router just has
to look up the routing table and forward the packet to next hop.
Path-Vector Routing
Path-vector routing is a routing algorithm that is useful for interdomain routing.
It is based on a similar principle as Distance vector routing, it assumes that there is one
node in each system, and it acts on behalf of the entire autonomous system is
called Speaker node. It creates a routing cable and advertises to the speaker node.