0% found this document useful (0 votes)
8 views

Module3-Chapter1

The document provides an overview of the network layer, detailing its services such as packetizing, routing, and forwarding. It explains packet switching methods including datagram (connectionless) and virtual circuit (connection-oriented) approaches, along with IPv4 addressing and its classes. Additionally, it covers subnetting, address aggregation, special addresses, and Network Address Translation (NAT) for mapping private to public addresses.

Uploaded by

jayanth aradhya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Module3-Chapter1

The document provides an overview of the network layer, detailing its services such as packetizing, routing, and forwarding. It explains packet switching methods including datagram (connectionless) and virtual circuit (connection-oriented) approaches, along with IPv4 addressing and its classes. Additionally, it covers subnetting, address aggregation, special addresses, and Network Address Translation (NAT) for mapping private to public addresses.

Uploaded by

jayanth aradhya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 53

Module 3

NETWORK LAYER
(only selected topics for
first internals)

1.1
The services which are offered by the network layer protocol are as follows:
1.Packetizing
2.Routing
3.Forwarding
Packetizing
The source is not
network layer
allowed to change
carries a payload
the content of the
from the source to
payload unless it is
the destination
too large for delivery
without changing it
and needs to be
or using it.
fragmented..
SOURCE

The source host adds


a header that
contains the source
and destination
address and some
other relevant The destination host If the packet is
information. receives the network fragmented at the source
layer packet from its data or at routers along the
link layer, decapsulates path, it waits until all
the packet, and delivers fragments arrive,
the payload to the reassembling them, and
corresponding upper delivering them to the
layer protocol. upper-layer protocol.

RECEIVER

The routers in the path


are not allowed to
decapsulate the packets
Routing
• The network layer is responsible for routing the packet from its source to
the destination.
• A network is a combination of networks (LANs and WANs) and routers that
connect them. This means that there is more than one route from the
source to the destination.
• The network layer is responsible for finding the best one among these
possible routes.
• This is done by running some routing protocols to help the routers
coordinate their knowledge about the neighborhood and to come up with
consistent tables to be used when a packet arrives.
Forwarding
Is the action applied by each router when a packet arrives at
one of its interfaces.

Forwarding Send the packet


value out of interface 2
B Data B Data
Other services expected from network layers are:
• Error control
• Flow control
• Congestion control
• Quality of service
• Security
PACKET SWITCHING
• Here, the message is split up into several packet-like pieces and sent from
the source to the destination one at a time.
• A header(source address and a destination address) and a payload are the
two components of each packet.
• It uses Store and Forward technique .
• packet-switched network can use two different approaches to route the
packets: the datagram approach and the virtual circuit approach
Datagram Approach: Connectionless
Service
• connectionless service in which the network-layer protocol treats each packet
independently, with each packet having no relationship to any other packet.
• each packet is treated independently and belonging to one flow may take
different routes because routing decisions are made dynamically
• packets that arrived at the destination might be out of order.
• It has no connection setup and teardown phase, like Virtual Circuits.
• The switches in this type of network are called routers.
• Delays in Packet switching:
Transmission Delay: Time required by station to transmit data to the link.
Propagation Delay: Time of data propagation through the link.
Queuing Delay: Time spend by the packet at the destination’s queue.
Processing Delay: Processing time for data at the destination.
A connectionless packet-switched network

18.12
SA DA Data SA DA Data

Each packet is routed based on the information contained in its header: source and
destination addresses
Virtual-Circuit Approach: Connection-Oriented Service
• In a connection-oriented service there is a relationship between all packets
belonging to a message.
• A path is established between the source and the destination through which all
the packets will be routed during a call.
• This path is called a virtual circuit because to the user, the connection appears to
be a dedicated physical circuit.
• After connection setup, the datagrams can all follow the same path.
• All intermediate nodes between the two points put an entry of the routing in
their routing table with additional parameters like max packet size for the call.
• Additional to source and destination addresses, it must also contain a flow label,
a virtual circuit identifier that defines the virtual path the packet should follow.
• The virtual circuit is cleared after the data transfer is completed.
Figure 18.5: A virtual-circuit packet-switched network

18.16
Figure 18.6: Forwarding process in a router when used in a
virtual circuit network

Incoming
Outgoing
label
label

18.17
a three-phase process is used: setup, data transfer, and teardown.
• In the setup phase, the source and destination addresses of the sender and
receiver are used to make table entries for the connection-oriented service.
• In the teardown phase, the source and destination inform the router to
delete the corresponding entries.
• Data transfer occurs between these two phases.
Setup Phase
• a router creates an entry for a virtual circuit.
• Two auxiliary packets need to be exchanged between the sender and the
receiver: the request packet and the acknowledgment packet.
Teardown Phase
• In the teardown phase, source A, after sending all packets to B, sends a
special packet called a teardown packet.
• Destination B responds with a confirmation packet.
• All routers delete the corresponding entries from their tables.
Figure 18.7: Sending request packet in a virtual-
circuit network

A to B

A to B

A to B A to B

18.19
Figure 18.8: Sending acknowledgments in a virtual-circuit
network

18.20
Figure 18.9: Flow of one packet in an established virtual
circuit

18.21
Datagram approach Virtual Circuit approach

Node takes routing decisions to Node does not take any routing
forward the packets. decision.

Congestion cannot occur as all the Congestion can occur when the node
packets travel in different directions. is busy, and it does not allow other
packets to pass through.

It is more flexible as all the packets It is not very flexible.


are treated as an independent entity.
Disadvantages of packet switching:
• They are unsuitable for applications that cannot afford delays in
communication like high quality voice calls.
• Packet switching high installation costs.
• They require complex protocols for delivery.
• Network problems may introduce errors in packets, delay in delivery of
packets or loss of packets. If not properly handled, this may lead to loss of
critical information.
IPV4 ADDRESSES
• An Internet Protocol address is a unique identifier for devices connected to a
network.
• It is a string of numbers separated by periods.
• IP addressing range goes from 0.0.0.0 to 255.255.255.255.
• IP address is the address of the connection, not the host or the router.
• IPV4: Internet Protocol Version Four
• IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a host or a router to the Internet.
• It is a connectionless protocol.
Address Space
• An address space is the total number of addresses used by the protocol.
• IPv4 uses 32-bit addresses, the address space is 2^32 or 4,294,967,296.
• There are three common notations to show an IPv4 address: binary
notation (base 2), dotted-decimal notation (base 256), and hexadecimal
notation (base 16).
Hierarchy in
addressing

The IPv4 address is divided into two parts:


• Network ID
• Host ID

A prefix can be fixed length or variable length.


Classful Addressing

• an IPv4 address was designed with a fixed-length prefix


• to accommodate both small and large networks, three fixed-length
prefixes were designed instead of one (n = 8, n = 16, and n = 24).
• The whole address space was divided into five classes (class A, B, C, D,
and E)
Figure 18.18: Occupation of the address space in classful
addressing
Class A
• IP addresses belonging to class A are assigned to the networks that contain a
large number of hosts.
• The network ID is 8 bits long.
• The host ID is 24 bits long.
• The higher-order bit of the first octet in class A is always set to 0.
• The remaining 7 bits in the first octet are used to determine network ID.
27 = 128 networks in the world that can have a class A address
• The 24 bits of host ID are used to determine the host in any network.
2^24 – 2 = 16,777,214 host ID
• IP addresses belonging to class A ranges from 1.0.0.0 – 126.255.255.255.
Class B
• IP address belonging to class B is assigned to networks that range from medium-
sized to large-sized networks.
• The network ID is 16 bits long.
• The host ID is 16 bits long.
• The higher-order bits of the first octet of IP addresses of class B are always set to
10.
• The remaining 14 bits are used to determine the network ID.
• The 16 bits of host ID are used to determine the host in any network.
• Class B has a total of:
• 2^14 = 16384 network address
• 2^16 – 2 = 65534 host address
• IP addresses belonging to class B ranges from 128.0.0.0 – 191.255.255.255.
Class C
• IP addresses belonging to class C are assigned to small-sized networks.
• The network ID is 24 bits long.
• The host ID is 8 bits long.
• The higher-order bits of the first octet of IP addresses of class C is always set
to 110.
• The remaining 21 bits are used to determine the network ID.
• The 8 bits of host ID are used to determine the host in any network.
• Class C has a total of:
• 2^21 = 2097152 network address
• 2^8 – 2 = 254 host address
• IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.
Class D
• IP address belonging to class D is reserved for multi-casting.
• The higher-order bits of the first octet of IP addresses belonging to class D is
always set to 1110.
• IP addresses belonging to class D range from 224.0.0.0 – 239.255.255.255.

Class E
• IP addresses belonging to class E are reserved for experimental and research
purposes.
• IP addresses of class E range from 240.0.0.0 – 255.255.255.254.
• The higher-order bits of the first octet of class E are always set to 1111.
• To reduce the address depletion, two strategies were proposed: subnetting and
supernetting.
• Subnetting is the procedure to divide the network into sub-networks or small
networks, these smaller networks are known as subnets.
• Computers belong to a subnet are addressed with an identical MSB group in IP
addresses.
• a few bits from the host portion are used to design small-sized subnetworks from
the original network.
• if all of the addresses in a network are not used, subnetting allows the addresses
to be divided among several organizations.
• Supernetting is the procedure to combine small networks into larger
spaces.
• Host addresses’ bits are increased.
Classless Addressing
Extracting Information from an Address
Given any address in the block, we normally like to know three pieces of information about the block to
which the address belongs: the number of addresses, the first address in the block, and the last address.
Since the value of prefix length, n, is given, we can easily find these three pieces of information, as shown
in Figure 18.21.
1. The number of addresses in the block is found as N = 232−n.
2. To find the first address, we keep the n leftmost bits and set the (32 − n) rightmost bits all to 0s.
3. To find the last address, we keep the n leftmost bits and set the (32 − n) rightmost bits all to 1s.
Subnetting
• More levels of hierarchy can be created using subnetting.
• An organization (or an ISP) that is granted a range of addresses may divide the range
into several subranges and assign each subrange to a subnetwork (or subnet).
• Note that nothing stops the organization from creating more levels. A subnetwork
can be divided into several sub-subnetworks.
• A sub-subnetwork can be divided into several sub-sub-subnetworks, and so on.
Designing Subnets:
• The subnetworks in a network should be carefully designed to enable the routing of
packets.
• We assume the total number of addresses granted to the organization is N, the
prefix length is n, the assigned number of addresses to each subnetwork is Nsub,
and the prefix length for each subnetwork is nsub.
Then the following steps need to be carefully followed to guarantee the
proper operation of the subnetworks.
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 be done 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
grants the subblocks to its customers.
Special Addresses
• This-host Address : The only address in the block 0.0.0.0/32 is called the this-host address. It is
used when ever a host needs to send an IP datagram but it does not know its own address to use
as the source address.
• Limited-broadcast Address: The only address in the block 255.255.255.255/32 is called the
limited-broadcast address. It is used whenever a router or a host needs to send a datagram to all
devices in a network.
• Loopback Address : The block 127.0.0.0/8 is called the loopback address. A packet with one of the
addresses in this block as the destination address never leaves the host; it will remain in the host.
Any address in the block is used to test a piece of software in the machine. For example, we can
write a client and a server program in which one of the addresses in the block is used as the
server address. We can test the programs using the same host to see if they work before running
them on different computers.
• Private Addresses: Four blocks are assigned as private addresses: 10.0.0.0/8, 172.16.0.0/12,
192.168.0.0/16, and 169.254.0.0/16.
• Multicast Addresses : The block 224.0.0.0/4 is reserved for multicast addresses.
Network Address Resolution (NAT)
• A technology that can provide the mapping between the private and
universal addresses, and at the same time support virtual private
networks, is Network Address Translation (NAT).
• The technology allows a site to use a set of private addresses for
internal communication and a set of global Internet addresses (at
least one) for communication with the rest of the world.
• The site must have only one connection to the global Internet through
a NAT-capable router that runs NAT software. Figure 18.29 shows a
simple implementation of NAT.
Address Translation
• All of the outgoing packets go through the NAT router, which replaces
the source address in the packet with the global NAT address.
• All incoming packets also pass through the NAT router, which replaces
the destination address in the packet (the NAT router global address)
with the appropriate private address.
• Figure 18.30 shows an example of address translation.
Translation Table
• The reader may have noticed that translating the source addresses for an
outgoing packet is straightforward. But how does the NAT router know the
destination address for a packet coming from the Internet?
• There may be tens or hundreds of private IP addresses, each belonging to
one specific host. The problem is solved if the NAT router has a translation
table.
Using One IP Address:
• In its simplest form, a translation table has only two columns: the private
address and the external address (destination address of the packet).
• When the router translates the source address of the outgoing packet, it also
makes note of the destination address— where the packet is going.
• When the response comes back from the destination, the router uses the
source address of the packet (as the external address) to find the private
address of the packet. Figure 18.31 shows the idea.
Using a Pool of IP Addresses:
• The use of only one global address by the NAT router allows only one
private-network host to access a given external host.
• To remove this restriction, the NAT router can use a pool of global
addresses. For example, instead of using only one global address
(200.24.5.8), the NAT router can use four addresses (200.24.5.8, 200.24.5.9,
200.24.5.10, and 200.24.5.11).
• In this case, four private-network hosts can communicate with the same
external host at the same time because each pair of addresses defines a
separate connection.
• However, there are still some drawbacks. No more than four con nections
can be made to the same destination. No private-network host can access
two external server programs (e.g., HTTP and TELNET) at the same time.
• And, likewise, two private-network hosts cannot access the same external
server program (e.g., HTTP or TELNET) at the same time.
Using Both IP Addresses and Port Addresses:
• To allow a many-to-many relationship between private-network hosts
and external server programs, we need more information in the
translation table.
• For example, sup pose two hosts inside a private network with
addresses 172.18.3.1 and 172.18.3.2 need to access the HTTP server
on external host 25.8.3.2.
• If the translation table has five columns, instead of two, that include
the source and destination port addresses and the transport-layer
protocol, the ambiguity is eliminated.
• Table 18.1 shows an example of such a table.

You might also like