0% found this document useful (0 votes)
3 views14 pages

Data Communication Module 5

Module 5 of Data Communication discusses the Network Layer, which is responsible for host-to-host delivery of datagrams, routing, forwarding, error control, flow control, congestion control, and security. It covers packet switching, addressing methods, performance metrics such as delay, throughput, and packet loss, and details on IPv4 addressing and its hierarchical structure. The document emphasizes the importance of managing network traffic and ensuring efficient data transmission.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views14 pages

Data Communication Module 5

Module 5 of Data Communication discusses the Network Layer, which is responsible for host-to-host delivery of datagrams, routing, forwarding, error control, flow control, congestion control, and security. It covers packet switching, addressing methods, performance metrics such as delay, throughput, and packet loss, and details on IPv4 addressing and its hierarchical structure. The document emphasizes the importance of managing network traffic and ensuring efficient data transmission.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Data Communication (21CD44)

MODULE 5:Introduction to Network Layer


NETWORK LAYER SERVICES:
 The network layer in the TCP/IP protocol suite is responsible for the host-to-host
delivery of datagrams.
 It provides services to the transport layer and receives services from the data-link
layer.
 The network layer translates the logical addresses into physical addresses
 It determines the route from the source to the destination and also manages the traffic
problems such as switching, routing and controls the congestion of data packets.
 The main role of the network layer is to move the packets from sending host to the
receiving host.
Services provided by network layer are
PACKETIZING
 The first duty of the network layer is definitely packetizing.
 This means encapsulating the payload (data received from upper layer) in a network-
layer packet at the source and decapsulating the payload from the network-layer
packet at the destination.
 The network layer is responsible for delivery of packets from a sender to a receiver
without changing or using the contents.

ROUTING AND FORWARDING


Routing
 The network layer is responsible for routing the packet from its source to the
destination.
 The network layer is responsible for finding the best one among these possibleroutes.
 The network layer needs to have some specific strategies for defining the bestroute.
 Routing is the concept of applying strategies and running routing protocols tocreate
the decision-making tables for each router.
 These tables are called as routing tables.
Forwarding
 Forwarding can be defined as the action applied by each router when a packet
arrives at one of its interfaces.
 The decision-making table, a router normally uses for applying this action iscalled
the forwarding table.
 When a router receives a packet from one of its attached networks, it needs to
forward the packet to another attached network.
ERROR CONTROL
 The network layer in the Internet does not directly provide error control.
 It adds a checksum field to the datagram to control any corruption in the header, but
not in the whole datagram.
 This checksum prevents any changes or corruptions in the header of the datagram.
 The Internet uses an auxiliary protocol called ICMP, that provides some kind of
error control if the datagram is discarded or has some unknown information in the
header.
FLOW CONTROL
 Flow control regulates the amount of data a source can send without overwhelming
the receiver.
 The network layer in the Internet, however, does not directly provide any flow control.
 The datagrams are sent by the sender when they are ready, without any attention to
the readiness of the receiver.
 Flow control is provided for most of the upper-layer protocols that use the services of
the network layer, so another level of flow control makes the network layer more
complicated and the whole system less efficient.
CONGESTION CONTROL
 Another issue in a network-layer protocol is congestion control.
 Congestion in the network layer is a situation in which too many datagrams are
present in an area of the Internet.
 Congestion may occur if the number of datagrams sent by source computers is
beyond the capacity of the network or routers.
 In this situation, some routers may drop some of the datagrams.
SECURITY
 Another issue related to communication at the network layer is security.
To provide security for a connectionless network layer, we need to have another virtual level that changes
the connectionless service to a connection- oriented service. This virtual layer is called as called IPSec (IP
Security).

PACKET SWITCHING
• The message is divided into packets of fixed or variable size.
• The packet-size is determined by → network and → governing protocol.
• There is no resource reservation; resources are allocated on-demand.
Datagram Networks
• This is analogous to postal system.
• Each packet is routed independently through the network.
• Each packet has a header that contains source and destination addresses.
• Each switch examines the header to determine the next hop in the path to the destination.
• If the transmission line is busy then the packet is placed in the queue until the line becomes free.
• Packets are referred to as datagrams.
• Datagram switching is normally done at the network layer.
• In Internet, switching is done by using the datagram switching.
• Advantage:
1) High utilization of transmission-line can be achieved by sharing among multiple packets.
• Disadvantages:
1) Packets may arrive out-of-order, and re-sequencing may be required at the destination
2) Loss of packets may occur when a switch has insufficient buffer
The Figure shows how the 4 packets are transferred from station-A to station-X. The switches are referred to
as routers. All four packets (or datagrams) belong to the same message, but may travel different paths to
reach their destination. This is so because the links may be involved in carrying packets from other sources
and do not have the necessary bandwidth available to carry all the packets from A to [Link] approach can
cause the datagrams of a transmission to arrive at their destination out-oforder with different delays between
the [Link] may also be lost or dropped because of a lack-of-resources. It is the responsibility of an
upper-layer protocol to → reorder the datagrams or → ask for lost [Link] datagram-networks are
referred to as connectionless networks. This is because
1) The switch does not keep information about the connection state.
2) There are no setup or teardown phases.
3) Each packet is treated the same by a switch regardless of its source or destination.
Virtual Circuit Network (VCN)
• This is similar to telephone system.
• A virtual-circuit network is a combination of circuit-switched-network and datagram-network.
• Five characteristics of VCN:
1) As in a circuit-switched-network, there are setup & teardown phases in addition to the data transfer phase.
2) As in a circuit-switched-network, resources can be allocated during the setup phase. As in a datagram-
network, resources can also be allocated on-demand.
3) As in a datagram-network, data is divided into packets. Each packet carries an address in the header.
However, the address in the header has local jurisdiction, not end-to-end jurisdiction.
4) As in a circuit-switched-network, all packets follow the same path established during the connection.
5) A virtual-circuit network is implemented in the data link layer. A circuit-switched-network is
implemented in the physical layer. A datagram-network is implemented in the network layer.
Addressing
• Two types of addressing:
1) Global
2) Local (virtual-circuit identifier).
1) Global Addressing:
A source or a destination needs to have a global address. Global address is an address that can be unique in
the scope of the network or internationally if the network is part of an international network.
2) Virtual Circuit Identifier:
The identifier used for data-transfer is called the virtual-circuit identifier (VCI). A VCI, unlike a global
address, is a small number that has only switch [Link] is used by a frame between two [Link] a
frame arrives at a switch, it has a VCI. When the frame leaves, it has a different VCI.

NETWORK-LAYER PERFORMANCE
 The performance of a network can be measured in terms of
Delay, Throughput and Packet loss.
 Congestion control is an issue that can improve the performance.

DELAY

 A packet from its source to its destination, encounters delays.


 The delays in a network can be divided into four types:
Transmission delay, Propagation delay, Processing delay and Queuing delay.

Transmission Delay

 A source host or a router cannot send a packet instantaneously.


 A sender needs to put the bits in a packet on the line one by one.
 If the first bit of the packet is put on the line at time t1 and the last bit is put onthe line
at time t2, transmission delay of the packet is (t2 - t1).
 The transmission delay is longer for a longer packet and shorter if the sendercan
transmit faster.
 The Transmission delay is calculated using the formula
Delaytr = (Packet length) / (Transmission rate)

 Example :
In a Fast Ethernet LAN with the transmission rate of 100 million bits per
second and a packet of 10,000 bits, it takes (10,000)/(100,000,000) or 100
microseconds for all bits of the packet to be put on the line.
Propagation Delay

 Propagation delay is the time it takes for a bit to travel from point A to point Bin the
transmission media.
 The propagation delay for a packet-switched network depends on thepropagation
delay of each network (LAN or WAN).
 The propagation delay depends on the propagation speed of the media, which is
3X108 meters/second in a vacuum and normally much less in a wired medium.
 It also depends on the distance of the link.
 The Propagation delay is calculated using the formula
Delaypg = (Distance) / (Propagation speed)

 Example
If the distance of a cable link in a point-to-point WAN is 2000 meters and the
propagation speed of the bits in the cable is 2 X 108 meters/second, then the
propagation delay is 10 microseconds.
Processing Delay

 The processing delay is the time required for a router or a destination host to receive
a packet from its input port, remove the header, perform an error detection
procedure, and deliver the packet to the output port (in the case of arouter) or
deliver the packet to the upper-layer protocol (in the case of thedestination host).
 The processing delay may be different for each packet, but normally iscalculated as
an average.

Delaypr = Time required to process a packet in a router or a destination host

Queuing Delay

 Queuing delay can normally happen in a router.


 A router has an input queue connected to each of its input ports to store packets
waiting to be processed.
 The router also has an output queue connected to each of its output ports tostore
packets waiting to be transmitted.
 The queuing delay for a packet in a router is measured as the time a packetwaits
in the input queue and output queue of a router.
Delayqu = The time a packet waits in input and output queues in a router

Total Delay

 Assuming equal delays for the sender, routers and receiver, the total delay (source-to-
destination delay) of a packet can be calculated if we know the number of routers, n,
in the whole path.
Total delay = (n + 1) (Delaytr + Delaypg + Delaypr) + (n) (Delayqu)

 If we have n routers, we have (n +1) links.


 Therefore, we have (n +1) transmission delays related to n routers and the source, (n
+1) propagation delays related to (n +1) links, (n +1) processing delays related to n
routers and the destination, and only n queuing delaysrelated to n routers.
THROUGHPUT

 Throughput at any point in a network is defined as the number of bits passing through
the point in a second, which is actually the transmission rate of data at that point.
 In a path from source to destination, a packet may pass through several links
(networks), each with a different transmission rate.
 Throughput is calculated using the formula
Throughput = minimum{TR1 , TR2, . . . TRn}
 Example:
Let us assume that we have three links, each with a different transmissionrate.
The data can flow at the rate of 200 kbps in Link1, 100 kbps in Link2 and150kbps in
Link3.
Throughput = minimum{200,100,150} = 100.

PACKET LOSS

 Another issue that severely affects the performance of communication is the


number of packets lost during transmission.
 When a router receives a packet while processing another packet, the receivedpacket
needs to be stored in the input buffer waiting for its turn.
 A router has an input buffer with a limited size.
 A time may come when the buffer is full and the next packet needs to be
dropped.
 The effect of packet loss on the Internet network layer is that the packet needsto be
resent, which in turn may create overflow and cause more packet loss.

CONGESTION CONTROL

 Congestion at the network layer is related to two issues, throughput and delay.

Based on Delay

 When the load is much less than the capacity of the network, the delay is at a
minimum.
 This minimum delay is composed of propagation delay and processing delay,both
of which are negligible.
 However, when the load reaches the network capacity, the delay increases
sharply because we now need to add the queuing delay to the total delay.
 The delay becomes infinite when the load is greater than the capacity.

Based on Throughout

 When the load is below the capacity of the network, the throughput increases
proportionally with the load.
 We expect the throughput to remain constant after the load reaches thecapacity, but
instead the throughput declines sharply.
 The reason is the discarding of packets by the routers.
 When the load exceeds the capacity, the queues become full and the routers have to
discard some packets.
 Discarding packets does not reduce the number of packets in the network
because the sources retransmit the packets, using time-out mechanisms, when the
packets do not reach the destinations.

IPV4 ADDRESSES
 The identifier used in the IP layer of the TCP/IP protocol suite to identify the
connection of each device to the Internet is called the Internet address or IP address.
 Internet Protocol version 4 (IPv4) is the fourth version in the development of the
Internet Protocol (IP) and the first version of the protocol to be widely deployed.
 IPv4 is described in IETF publication in September 1981.
 The IP address is the address of the connection, not the host or the router. An IPv4
address is a 32-bit address that uniquely and universally defines theconnection .
 If the device is moved to another network, the IP address may be changed.
 IPv4 addresses are unique in the sense that each address defines one, and onlyone,
connection to the Internet.
 If a device has two connections to the Internet, via two networks, it has twoIPv4
addresses.
 Pv4 addresses are universal in the sense that the addressing system must be
accepted by any host that wants to be connected to the Internet.

IPV4 ADDRESS SPACE

 IPv4 defines addresses has an address space.


 An address space is the total number of addresses used by the protocol.
 If a protocol uses b bits to define an address, the address space is 2b becauseeach
bit can have two different values (0 or 1).
 IPv4 uses 32-bit addresses, which means that the address space is 232 or
4,294,967,296 (more than four billion).
 4 billion devices could be connected to the Internet.
IPV4 ADDRESS NOTATION
There are three common notations to show an IPv4 address:
(i) binary notation (base 2), (ii) dotted-decimal notation (base 256), and
(ii) hexadecimal notation (base 16).

In binary notation, an IPv4 address is displayed as 32 bits. To make the address more
readable, one or more spaces are usually inserted between bytes (8 bits).
In dotted-decimal notation,IPv4 addresses are usually written in decimal form with a decimal
point (dot) separating the bytes. Each number in the dotted-decimal notation is between 0
and 255.
In hexadecimal notation, each hexadecimal digit is equivalent to four bits. This means that a
32-bit address has 8 hexadecimal digits. This notation is often used in network programming.

HIERARCHY IN IPV4 ADDRESSING

 In any communication network that involves delivery, the addressing system is


hierarchical.
 A 32-bit IPv4 address is also hierarchical, but divided only into two parts.
 The first part of the address, called the prefix, defines the network(Net ID); the
second part of the address, called the suffix, defines the node (Host ID).
 The prefix length is n bits and the suffix length is (32- n) bits.

 A prefix can be fixed length or variable length.


 The network identifier in the IPv4 was first designed as a fixed-length prefix.
 This scheme is referred to as classful addressing.
 The new scheme, which is referred to as classless addressing, uses a variable-length
network prefix.
CATEGORIES OF IPV4 ADDRESSING

 There are two broad categories of IPv4 Addressing techniques.


 They are
 Classful Addressing
 Classless Addressing
CLASSFUL ADDRESSING

 An IPv4 address is 32-bit long(4 bytes).


 An IPv4 address is divided into sub-classes:

Classfull Network Architecture

Class A

 In Class A, an IP address is assigned to those networks that contain a large


number of hosts.
 The network ID is 8 bits long.
 The host ID is 24 bits long.
 In Class A, the first bit in higher order bits of the first octet is always set to 0and
the remaining 7 bits determine the network ID.
 The 24 bits determine the host ID in any network.
 The total number of networks in Class A = 27 = 128 network addressThe total number of

hosts in Class A = 224 - 2 = 16,777,214


Class B
 In Class B, an IP address is assigned to those networks that range from small-sized
to large-sized networks.
 The Network ID is 16 bits long.
 The Host ID is 16 bits long.
 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.
 The total number of networks in Class B = 214 = 16384 network address
 The total number of hosts in Class B = 216 - 2 = 65534 host address

Class C

 In Class C, an IP address is assigned to only small-sized networks.


 The Network ID is 24 bits long.
 The host ID is 8 bits long.
 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.
 The total number of networks = 221 = 2097152 network address
 The total number of hosts = 28 - 2 = 254 host address
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 remainingbits
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 remainingbits
determines the host ID in any network.
Address Depletion in Classful Addressing

 The reason that classful addressing has become obsolete is address


depletion.
 Since the addresses were not distributed properly, the Internet
was faced with the problem of the addresses being rapidly used
up.
 This results in no more addresses available for organizations
and individuals that needed to be connected to the Internet.
 To understand the problem, let us think about class A.
 This class can be assigned to only 128 organizations in the
world, but each organization needs to have a single network
with 16,777,216 nodes .
 Since there may be only a few organizations that are this large,
most of the addresses in this class were wasted (unused).
 Class B addresses were designed for midsize organizations, but
many of the addresses in this class also remained unused.
 Class C addresses have a completely different flaw in design.
The number of addresses that can be used in each network (256)
was so small that most companies were not comfortable using
a block in this address class.
 Class E addresses were almost never used, wasting the whole class.

Advantage of Classful Addressing

 Although classful addressing had several problems and


became obsolete, it hadone advantage.
 Given an address, we can easily find the class of the
address and, since theprefix length for each class is fixed, we
can find the prefix length immediately.
 In other words, the prefix length in classful addressing is
inherent in theaddress; no extra information is needed to
extract the prefix and the suffix.

Sub-netting and Supernetting

 To alleviate address depletion, two strategies were proposed and


implemented:
(i) Subnetting and (ii) Supernetting.
Sub-netting

 In subnetting, a class A or class B block is divided into several subnets.


 Each subnet has a larger prefix length than the original network.
 For example, if a network in class A is divided into four
subnets, each subnethas a prefix of nsub = 10.
 At the same time, if all of the addresses in a network are not
used, subnettingallows the addresses to be divided among
several organizations.

CLASSLESS ADDRESSING

 In 1996, the Internet authorities announced a new architecture


called classlessaddressing.
 In classless addressing, variable-length blocks are used that
belong to noclasses.
 We can have a block of 1 address, 2 addresses, 4 addresses,
128 addresses, andso on.
 In classless addressing, the whole address space is divided
into variable lengthblocks.
 The prefix in an address defines the block (network); the
suffix defines thenode (device).
 Theoretically, we can have a block of 20, 21, 22, 232
addresses.
 The number of addresses in a block needs to be a power of 2.
An organizationcan be granted one block of addresses.

 The prefix length in classless addressing is variable.


 We can have a prefix length that ranges from 0 to 32.
 The size of the network is inversely proportional to the length of the
prefix.
 A small prefix means a larger network; a large prefix means a smaller
network.
 The idea of classless addressing can be easily applied to classful
addressing.
 An address in class A can be thought of as a classless address
in which the prefix length is 8.
 An address in class B can be thought of as a classless address
in which the prefix is 16, and so on. In other words, classful
addressing is a special case of classless addressing.
Notation used in Classless Addressing

 The notation used in classless addressing is informally referred


to as slash notation and formally as classless interdomain
routing or CIDR.
 For example , [Link] /24 represents the IP address
192.168.100.14and, its subnet mask [Link], which has
24 leading 1-bits.

Address Aggregation

 One of the advantages of the CIDR strategy is address


aggregation(sometimes called address summarization or route
summarization).
 When blocks of addresses are combined to create a larger
block, routing can bedone based on the prefix of the larger
block.
 ICANN assigns a large block of addresses to an ISP.
 Each ISP in turn divides its assigned block into smaller
subblocks and grantsthe subblocks to its customers.
Special Addresses in IPv4

There are five special addresses that are used for special purposes: this-
host address,limited-broadcast address, loopback address,private
addresses,and multicast addresses.
This-host Address
 The only address in the block [Link]/32 is called the this-host address.
 It is used whenever a host needs to send an IP datagram but it
does not know itsown address to use as the source address.
Limited-broadcast Address
 The only address in the block [Link]/32 is called
the limited-broadcast address.
 It is used whenever a router or a host needs to send a datagram
to all devices ina network.
 The routers in the network, however, block the packet
having this address asthe destination;the packet cannot travel
outside the network.
Loopback Address
 The block [Link]/8 is called the loopback address.
 A packet with one of the addresses in this block as the
destination addressnever leaves the host; it will remain in the
host.
Private Addresses
 Four blocks are assigned as private addresses: [Link]/8,
[Link]/12,[Link]/16, and [Link]/16.
Multicast Addresses
 The block [Link]/4 is reserved for multicast addresses.

You might also like