0% found this document useful (0 votes)
38 views63 pages

Computer networksUNIT 3

computer networksUNIT 3 PPT

Uploaded by

chinkyreddy1
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)
38 views63 pages

Computer networksUNIT 3

computer networksUNIT 3 PPT

Uploaded by

chinkyreddy1
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
You are on page 1/ 63

UNIT-3

NETWORK Layer
Design Issues
• Store-and-Forward Packet Switching
• Implementation of Connectionless Service (Datagram Switching
Subnet)
• Implementation of Connection-Oriented Service (Virtual Circuit
Switching Subnet)
• Services Provided to the Transport Layer
Store-and-Forward Packet Switching

•The major components of the system are the Subnet


(routers connected by transmission lines), and the Hosts.
•A host with a packet to send transmits it to the
nearest router, either on its own LAN or over a
point-to-point link to the carrier. The packet is
stored there until it has fully arrived so the
checksum can be verified.
•Then it is forwarded to the next router along the
path until it reaches the destination host, where it is
delivered. This mechanism is store-and-forward
packet switching.
Services Provided to the Transport Layer

•The services should be independent of the router


technology.
•The transport layer should be shielded from the
number, type, and topology of the routers
present.
•The network addresses made available to the
transport layer should use a uniform numbering
plan, even across LANs and WANs.

Implementation of Connection-Oriented Service
(Virtual Circuit Switching Subnet)
• For connection-oriented service, we need a virtual-circuit subnet.
• The idea behind virtual circuits is to avoid having to choose a new
route for every packet sent. Instead, when a connection is established,
a route from the source machine to the destination machine is chosen
as part of the connection setup and stored in tables inside the routers.
• That route is used for all traffic flowing over the connection, exactly
the same way that the telephone system works
Implementation of Connectionless Service
(Datagram Switching Subnet)
• If connectionless service is offered, packets are injected into
the subnet individually and routed independently of each
other.
• No advance setup is needed.
• The packets are frequently called datagrams (in analogy
with telegrams) and the subnet is called a datagram subnet.
The routing algorithm
• The routing algorithm is that part of the network layer software
responsible for deciding which output line an incoming packet should
be transmitted on.
•Routing: Making the decision which routes to use.
•Forwarding: Looking up the outgoing line to use
for it in the routing tables.
• Non-adaptive Algorithms : Static and offline. They will not work if
there is any failure of link or modification of the subnet. Here the
path is calculated prior to the data transmission.
• Non-adaptive algorithms do not base their routing decisions on
measurements or estimates of the current traffic and topology. This
procedure is sometimes called static routing.
• Examples: Shortest path routing and Flooding
• Adaptive algorithms: Dynamic and online. These algorithms change
their routing decisions to reflect changes in the topology, and usually
the traffic as well. Adaptive algorithms differ in where they get their
information.
• (e.g., distance, number of hops, or estimated transit time).
SHORTEST PATH ROUTING
•The subnet is considered as a graph, with each node
of the graph representing a router and each arc of
the graph representing a communication line (often
called a link).
•To choose a route between a given pair of routers,
the algorithm just finds the shortest path between
them on the graph. One way of measuring path
length is the number of hops. Another metric is the
geographic distance in kilometres.
Dijkstra's algorithm
• Dijkstra's algorithm is a shortest path routing algorithm in which the
shortest path is measured from single source to all destinations in the
subnet graph.
• Each node is labelled (in parentheses) with its distance from the source node
along the best known path. Initially, no paths are known, so all nodes are labelled
with infinity.
• As the algorithm proceeds and paths are found, the labels may change, reflecting
better paths.
• A label may be either tentative or permanent. Initially, all labels are tentative.
When it is discovered that a label represents the shortest possible path from the
source to that node, it is made permanent and never changed thereafter.
FLOODING
• In this, every incoming packet is sent out on every outgoing
line except the one it arrived on.
• Flooding obviously generates vast numbers of duplicate
packets, in fact, an infinite number unless some measures
are taken to damp the process.
• Hop Counter: One such measure is to have a hop counter contained
in the header of each packet, which is decremented at each hop, with
the packet being discarded when the counter reaches zero.
• Apply Seq.No. in packet to avoid sending the same packet second
time.Keep in each routers per source a lists of packets already seen.
• Selective Flooding :Use only those lines that are going approximately
right direction.
Distance Vector Routing.

• Distance vector routing algorithms operate by having each


router maintain a table (i.e, a vector) giving the best known
distance to each destination and which line to use to get
there. These tables are updated by exchanging information
with the neighbours.
• The distance vector routing algorithm is sometimes called
Bellman-Ford routing algorithm and the Ford-Fulkerson
algorithm, after the researchers who developed it (Bellman,
1957; and Ford and Fulkerson, 1962).
Routing table for new estimated delay for J.
Link State Algorithm.
• Distance vector routing was used in the ARPANET until 1979, when it was
replaced by link state routing.
• The idea behind link state routing is simple and can be stated as five parts.
Each router must do the following:

• Discover its neighbours and learn their network addresses.
• Measure the delay or cost to each of its neighbours.
• Construct a packet telling all it has just learned.
• Send this packet to all other routers.
• Compute the shortest path to every other router
Hierarchical Routing
• As networks grow in size, the router routing tables grow
proportionally.

• There are some problems with the increase in network size


• Router memory consumed by increasing tables
• CPU time is needed to scan routing table and
• More bandwidth is needed to send status reports about
routing table.
• When hierarchical routing is used, the routers are divided into
regions, with each router knowing all the details about how to route
packets to destinations within its own region,
• For huge networks, a two-level hierarchy may be insufficient; it may
be necessary to group the regions into clusters, the clusters into
zones, the zones into groups, and so on, until we run out of names for
aggregations.
• Each cluster is made up of a no.of regions and region contains a
no.of routers.
Figure: (a) Subnet (b) Full table of 1A (c)
Hierarchical table of 1A
Broadcast Routing
• Broadcasting: Sending a packet to all destinations simultaneously is
called broadcasting. The algorithms used for broadcasting are called
the " Broadcast Routing algorithms".
• There are various methods for broadcast routing:

• Distinct point-to-point routing


• Flooding
• Multi Destination routing
• Spanning Tree Routing
• Reverse path Forwarding
Distinct point-to-point routing:
• The source simply send a distinct packet to each destination.
• Drawbacks:
• This method wasteful of bandwidth.
• It also requires the source to have a complete list of all destinations.
• Flooding is the forwarding of a packet from any node to every other
node attached to the router except the node from which the packet
arrived.
• Drawback: It generates too many packets and consumes too much
bandwidth.
Multi-destination routing:
• If this method is used, each packet contains either a list of
destinations or a bit map indicating the desired destinations.
• Spanning tree:
• A spanning tree is a subset of the subnet that includes all the routers
but contains no loops.
Reverse Path Forwarding:
• This algorithm works even when the routers do not know anything at
all about spanning trees.
Multicast Routing

• Multicasting: Sending a message to a group is called multicasting, and


its routing algorithm is called multicast routing.
•Routers learn about which of their hosts are in
which groups.
•Routers tell their neighbours, so the information
propagates through the subnet.
•To do multicast routing, each router computes a
spanning tree covering all other routers.
EXAMPLEFigure: (a) A network. (b) A spanning tree for the leftmost
router. (c) A multicast tree for group 1. (d) A multicast tree for group
2.
INTERNETWORKING

• Internet: when two or more networks are connected to form an


internet. The Internet connects networks of different type.
Some of many ways the networks can differ
The Connectors Used for Internetworking at
different Layers
• In the physical layer, networks can be connected by repeaters or
hubs.
• In Data Link Layer, we use bridges and switches.
• In the network layer, we have routers that can connect two
networks.
• A router that can handle multiple protocols is called a multiprotocol
router also called Gateways.
• In the transport layer we find transport gateways, which can
interface between two transport connections.
• Finally, in the application layer, application gateways translate
message semantics.
TYPES OF INTERNETWORKING
• Two styles of internetworking are possible:
• Connection-oriented concatenation of virtual circuit subnets, and
• Connection Less datagram internet style.
• CONCATENATED VIRTUAL CIRCUITS:

• In the concatenated virtual-circuit model, a connection to a host in a distant network is
set up in a way similar to the way connections are normally established.
• The subnet sees that the destination is remote and builds a virtual circuit to the router
nearest the destination network.
• CONNECTION LESS INTERNETWORKING ( DATAGRAM
INTERNETWORKING):

• In this model, the only service the network layer offers to the
transport layer is the ability to inject datagrams into the subnet
and hope for the best.
• There is no notion of a virtual circuit at all in the network layer,
let alone a concatenation of them.
• TUNNELING:
• Tunneling is where the source and destination hosts are on the same type of network,
but there is a different network in between.
• FRAGMENTATION:
• Each network imposes some maximum size on its packets. These limits have various
causes, among them:
• Hardware (e.g., the size of an Ethernet frame).
• Operating system (e.g., all buffers are 512 bytes).
• Protocols (e.g., the number of bits in the packet length field).
• Compliance with some (inter)national standard.
• Desire to reduce error-induced retransmissions to some level.
• Desire to prevent one packet from occupying the channel too long.
• The obvious solution for forwarding the packets with smaller size is to fragment the incoming
packet and transmit only those fragments. This process is called "Fragmentation".
There are two choices for Fragmentation
• Transparent Fragmentation: A packet is fragmented upon entering a network and is recombined
when fragments leave out of that network, so that the other networks are not able to know event
that some fragmentation took place somewhere. This is called "Transparent Fragmentation".
• Non-Transparent Fragmentation: When packet is fragmented, it is never, combined back at
intermediate node. The packet is recovered by combining only at the destination node.
• NETWORK LAYER IN THE INTERNET
• IP (Internet Protocol) holds the whole Internet together is the
network layer. Its job is to provide a best-efforts (i.e., not guaranteed)
way to transport datagrams from source to destination, without
regard to whether these machines are on the same network or
whether there are other networks in between them
THE INTERNET
The IP Protocol

• An IP datagram consists of a header part and a text part.


• The header has a 20-byte fixed part and a variable length optional part.
• Version (VER): This 4-bit field defines the version of the IPv4 protocol.
Currently the version is 4.
• Header length (HLEN): This 4-bit field defines the total length of the
datagram header in 4-byte words.
• Type of Service: This field allows the host to inform the subnet about
the kind of service it requires. Originally, the 6-bit field contained
(from left to right), a three-bit Precedence field and three flags, D, T,
and R.
• Total Length (TL): Specifies the total length of the IP datagram, in
bytes. Since this field is 16 bits wide, the maximum length of an IP
datagram is 65,535 bytes,
• Identification: This field allows the destination host to determine the
identity of the datagram fragment.
• DF stands for Don't Fragment: It is an order to the routers not to
fragment the datagram because the destination is incapable of
putting the pieces back together again. By marking the datagram with
the DF bit, the sender knows it will arrive in one piece.
• MF stands for More Fragments: All fragments except the last one
have this bit set. It is needed to know when all fragments of a
datagram have arrived.
• Fragment offset: This tells about the location of the fragment in the
current datagram. All fragments except the last one in a datagram
must be a multiple of 8 bytes, the elementary fragment unit.
• The Time to live field: is a counter used to limit packet lifetimes. It is
supposed to count time in seconds, allowing a maximum lifetime of
255 sec. It must be decremented on each hop and is supposed to be
decremented multiple times when queued for a long time in a router.
• The Protocol: Identifies the higher layer protocol carried in the
datagram.
• Header Checksum: A checksum computed over the header to provide
basic protection against corruption in transmission. This is not the
more complex CRC code typically used by data link layer technologies
such as Ethernet; it's just a 16- bit checksum.
• Source Address: The 32-bit IP address of the originator of the
datagram.
• Destination Address: The 32-bit IP address of the intended recipient
of the datagram.
• Options: One or more of several types of options may be included
after the standard headers in certain IP datagrams.
IP Addressing
IPV6 HEADER FORMAT
INTERNET CONTROL PROTOCOLS

• In addition to IP, which is used for data transfer, the Internet


has several control protocols used in the network layer,
including including ICMP, ARP, RARP, BOOTP, and DHCP.
• ICMP:The Internet Control Message Protocol The IP protocol
has no error-reporting or error-correcting mechanism.
• The IP protocol also lacks a mechanism for host and
management queries.
• The Internet Control Message Protocol (ICMP) has been
designed to compensate for the above two deficiencies.
• It is a companion to the IP protoco1.
• ARP:Address Resolution Protocol
• Anytime a host or a router has an IP datagram to send to another host or router,
it has the logical (IP) address of the receiver.
• If the sender is the host, the logical (IP) address is obtained from the
DNS or If the sender is a router the logical(IP) address is found in a
routing
• But the IP datagram must be encapsulated in a frame to be able to pass
through the physical network. This means that the sender needs the
physical address of the receiver.
• The host or the router sends an ARP query packet. The packet includes
the physical and IP addresses of the sender and the IP address of the
receiver.
Reverse Address Resolution Protocol (RARP)

• Reverse Address Resolution Protocol (RARP) finds the logical address for a machine that knows
only its physical address. Each host or router is assigned one or more logical (IP) addresses,
which are unique and independent of the physical (hardware) address of the machine.
• To create an IP datagram, a host or a router needs to know its own IP address or addresses.
• The IP address of a machine is usually read from its configuration file stored on a disk file.
• The machine can get its physical address (by reading its NIC, for example), which is unique
locally. It can then use the physical address to get the logical address by using the RARP
protocol.
• A RARP request is created and broadcast on the local network.
• Another machine on the local network that knows all the IP addresses will respond with a RARP
reply.
• The requesting machine must be running a RARP client program; the responding machine must
be running a RARP server program.
• The Bootstrap Protocol (BOOTP) is a client/server protocol designed to provide physical
address to logical address mapping. BOOTP is an application layer protocol.
• The administrator may put the client and the server on the same network or on different
networks.

• The Dynamic Host Configuration Protocol (DHCP) has been devised to provide static and
dynamic address allocation that can be manual or automatic.
• When a DHCP client sends a request to a DHCP server,
• The server first checks its static database.
• If an entry with the requested physical address exists in the static database, the permanent IP
address of the client is returned
• The dynamic aspect of DHCP is needed when a host moves from network to network or
is connected and disconnected from a network.
• DHCP provides temporary IP addresses for a limited time.The addresses assigned from
the pool are temporary address
THANK YOU

You might also like