You are on page 1of 27

MODULE -3 NETWORK LAYER

NETWORK LAYER

Network layer design issues, Routing algorithms - shortest path algorithm, Flooding,
Distance vector routing, Hierarchical routing, Broadcast routing, Multicast routing,
Congestion control algorithms, Network layer in the internet - The IP version 4 protocol, IP
addresses, IP version 6, Internet control protocols, OSPF, BGP.

Network layer and design issues

The network layer or layer 3 of the OSI (Open Systems Interconnection) model is concerned
delivery of data packets from the source to the destination across multiple hops or links.
These issues encompass the services provided to the upper layers as well as internal design of
the layer.

The design issues can be elaborated under four heads –

• Store − and − Forward Packet Switching


• Services to Transport Layer

Service Store − and − Forward Packet Switching: The network layer operates in an
environment that uses store and forward packet switching.

 The node which has a packet to send, delivers it to the nearest router.
 The packet is stored in the router until it has fully arrived and its checksum is verified for
error detection.
 Once, this is done, the packet is forwarded to the next router.
 Since, each router needs to store the entire packet before it can forward it to the next hop,
the mechanism is called store − and − forward switching.

Services to Transport Layer :

• The network layer provides service its immediate upper layer, namely transport layer,
through the network − transport layer interface.

The two types of services provided are –

• Connection − Oriented Service − In this service, a path is setup between the source and the
destination, and all the data packets belonging to a message are routed along this path.

Dept -CSE Page 1


MODULE -3 NETWORK LAYER

• Connectionless Service − In this service, each packet of the message is considered as an


independent entity and is individually routed from the source to the destination. The objectives
of the network layer while providing these services are –

• The services should not be dependent upon the router technology.

• The router configuration details should not be of a concern to the transport layer.

• A uniform addressing plan should be made available to the transport layer, whether the network
is a LAN, MAN or WAN. Providing Connection Oriented Service In connection − oriented
services, a path or route called a virtual circuit is setup between the source and the destination
nodes before the transmission starts. When all the packets are transmitted, the virtual circuit is
terminated and the connection is released. An example of connection − oriented service is Multi-
Protocol Label Switching (MPLS).

ROUTING ALGORITHM

o In order to transfer the packets from source to the destination, the network layer must
determine the best route through which packets can be transmitted.
o Whether the network layer provides datagram service or virtual circuit service, the main
job of the network layer is to provide the best route. The routing protocol provides this
job.
o The routing protocol is a routing algorithm that provides the best path from the source to
the destination. The best path is the path that has the "least-cost path" from source to the
destination.
o Routing is the process of forwarding the packets from source to the destination but the
best route to send the packets is determined by the routing algorithm.

Classification of a Routing algorithm

The Routing algorithm is divided into two categories:

o Adaptive Routing algorithm


o Non-adaptive Routing algorithm

Dept -CSE Page 2


MODULE -3 NETWORK LAYER

Adaptive Routing algorithm

o An adaptive routing algorithm is also known as dynamic routing algorithm.


o This algorithm makes the routing decisions based on the topology and network traffic.
o The main parameters related to this algorithm are hop count, distance and estimated
transit time.

The Non-Adaptive (Static) Routing algorithm is of two types:

1. FLOODING:

In case of flooding, every incoming packet is sent to all the outgoing links except the one from it
has been reached.

Disadvantage of flooding

The disadvantage of flooding is that node may contain several copies of a particular packet.

How to avoid the duplicate packets?

By using hop counter


Decrement in each router
Discard packet if counter is ‘0’ except from which the packet is received
It uses sequence number to avoid duplicate packets.

Dept -CSE Page 3


MODULE -3 NETWORK LAYER

2. SHORTEST PATH ALGORITHM

The target of shortest path algorithms is to find a route between any pair of vertices along the
edges, so the sum of weights of edges is minimum. If the edges are of equal weights, the
shortest path algorithm aims to find a route having minimum number of hops.

Dijkstra Algorithm: (example of shortest path algorithm)

Dijkstra algorithm is a single-source shortest path algorithm. Here, single-source means that only
one source is given, and we have to find the shortest path from the source to all the nodes.

Let's understand the working of Dijkstra's algorithm. Consider the below graph.

A B C D E
A 0 ∞ ∞ ∞ ∞
C - 10 5 ∞ ∞
E - 8 - 14 7
B - 8 - 13 -
D - - - 9 -

Hence, A->C->B->D = 9 is a optimal path from source A to Destination D.

Tree graph Representation:

Dept -CSE Page 4


MODULE -3 NETWORK LAYER

 Difference between Routing and Flooding

Routing Flooding
Routing is the process of selecting an When a data packet arrives at a router, it is
optimal path across one or more networks. sent to all the outgoing links except the one
it has arrived on.

Routing table is maintained Routing table is not maintained


Reliability is less due to follows only one Reliability is more due to follows all
optimal path. available paths.
Traffic is less because of following only one Traffic is high because of which follows all
optimal path. available paths.
Hence, no duplicate packets in routing. Hence, there are possibility of duplicate
packets in flooding.

Dept -CSE Page 5


MODULE -3 NETWORK LAYER

The Adaptive (Dynamic) Routing algorithm is of one type:

DISTANCE-VECTOR ROUTING (DVR):

A distance-vector routing (DVR) protocol requires that a router inform its neighbors
of topology changes periodically. Historically known as the old ARPANET routing
algorithm (or known as Bellman-Ford algorithm).

Distance Vector Algorithm –


 A router transmits its distance vector to each of its neighbors in a routing packet.
 Each router receives and saves the most recently received distance vector from
each of its neighbors.
 A router recalculates its distance vector when:
 It receives a distance vector from a neighbor containing different information
than before.
 It discovers that a link to a neighbor has gone down.

The DV calculation is based on minimizing the cost to each destination by following


given below graph.

Initial routing table at Node A is:


Destination Cost/Distance Next Hop
A 0 A
B 1 B
C 5 C
D ∞ -
E ∞ -

Dept -CSE Page 6


MODULE -3 NETWORK LAYER

Distance Vector routing table at Node A is:


Destination Cost/Distance Next Hop
A 0 A
B 1 B
C 5 C
D 8 B
E 10 B

Note: As above we created or framed a table for node A as a initial routing table and distance
vector routing table, so that all other routers routing table should be created according.

HIERARCHICAL ROUTING:

In hierarchical routing, routers are classified in groups called regions. Each router has information about
the routers in its own region and it has no information about routers in other regions. So, routers save
one record in their table for every other region.
Consider an example of two-level hierarchy with five regions as shown in figure:

Full Table for 1A: Let see the full routing table for router 1A which has 17 entries, as shown below:

Dest. Line Hops

1A - -

1B 1B 1

1C 1C 1

2A 1B 2

2B 1B 3

2C 1B 3

Dept -CSE Page 7


MODULE -3 NETWORK LAYER

Dest. Line Hops

2D 1B 4

3A 1C 3

3B 1C 2

4A 1C 3

4B 1C 4

4C 1C 4

5A 1C 4

5B 1C 5

5C 1B 5

5D 1C 6

5E 1C 5

Hierarchical Table for 1A: When routing is done hierarchically then there will be only 7 entries
as shown below −

Dest. Line Hops

1A - -

1B 1B 1

1C 1C 1

2 1B 2

3 1C 2

4 1C 3

5 1C 4

Dept -CSE Page 8


MODULE -3 NETWORK LAYER

BROADCAST ROUTING:
A broadcast message is destined to all network devices.
Uncontrolled Flooding :

 most obvious technique for achieving broadcast is a flooding – Source node sends a copy of the
packet to all of its neighbors
 When a node receives a broadcast packet, it duplicates the packet and forwards it to all of its
neighbors (except the neighbor from which it received the packet).
 this scheme will eventually deliver a copy of the broadcast packet to all nodes if they are
connected

Disadvantages: –
(1) If the graph has cycles, then one or more copies of each broadcast packet will cycle indefinitely –
(2) When a node is connected to more than two other nodes, then it could result in broadcast storm
(resulting from the endless multiplication of broadcast packets)

Controlled Flooding:
key to avoiding a broadcast storm – for a node to judiciously choose when to flood and when not
to flood a packet – i.e. controlled way of flooding
Sequence-number:

 controlled flooding a source node puts its address as well as a broadcast sequence number
into a broadcast packet
 Each node maintains a list of the source address and sequence number of each broadcast
packet it has already received, duplicated, and forwarded •
 When a node receives a broadcast packet, it first checks in this list. – If found, then
dropped the packet – If not found, then the packet is duplicated and forwarded to all the
node’s neighbors (except the node from which the packet has just been received)

Reverse path forwarding (RPF) / reverse path broadcast (RPB ).


 When a router receives a broadcast packet with a given source address, it
transmits the packet on all of its outgoing links (except the one on which it was
received) » only if the packet arrived on the link that is on its own shortest
unicast path back to the source.
 Otherwise, the router simply discards the incoming packet
 RPF does not use unicast routing to actually deliver a packet to a destination, nor
does it require that a router know the complete shortest path from itself to the
source.
 RPF need only know the next neighbour on its unicast shortest path to the sender

Dept -CSE Page 9


MODULE -3 NETWORK LAYER

Spanning Tree Broadcast


 While sequence-number-controlled flooding and RPF avoid broadcast storms, – they do
not completely avoid the transmission of redundant broadcast packets
 In this figure, nodes B, C, D, E, and F receive either one or two redundant packets.
 Solution: spanning tree — a tree that contains each and every node in a graph so, first
construct a spanning tree.
 When a source node wants to send a broadcast packet, it sends the packet out on all of the
incident links that belong to the spanning tree.
 Not only does spanning tree eliminate redundant broadcast packets, but once in place, the
spanning tree can be used by any node to begin a broadcast.
 In this algorithm, a node need not be aware of the entire tree; it simply needs to know
which of its neighbors in G spanning-tree neighbors are.

MULTICAST ROUTING
• There is one source and a group of destinations, but not all.
• The relationship is one to many.

The source address is a unicast address, but the destination address is a group address, – in
which there is at least one member of the group that is interested in receiving the multicast
datagram.
• Multicasting is considered as the special case of broadcasting as it works in similar to
Broadcasting, but in Multicasting, the information is sent to the targeted or specific
members of the network.
• This task can be accomplished by transmitting individual copies to each user or node
present in the network, but sending individual copies to each user is inefficient and might
increase the network latency.
• To overcome these shortcomings, multicasting allows a single transmission that can be
split up among the multiple users, consequently, this reduces the bandwidth of the
signal.

Dept -CSE Page 10


MODULE -3 NETWORK LAYER

CONGESTION CONTROL ALGORITHM:


Congestion is condition in router in which Router discard packets when there are too many packets to
handle. Congestion control includes all set of policies, methods and techniques to handle or prevent
Congestion.

There are two methods to handle congestion (Principles)


A-Preventative Congestion Control (Open loop)
B-Detection and Removal Congestion Control (Closed loop)
Prevention is set of policies in those are applied to control congestion before it occurs. In this
technique a policy is embedded in Source or Destination. It is assumed that congestion will
never happen in Network after prevention.

Dept -CSE Page 11


MODULE -3 NETWORK LAYER

Preventative Congestion Control (Open loop): Prevent the congestion before it happens.

1. Packet Resending:
In this policy retransmission of packets is considered. If packet is lost or corrupted then
packet is retransmitted as soon as Sender feels it. If there are so many retransmissions
then there will be congestion. Congestion is prevented by implementing timers. Timers
are also used to optimize throughput.

2. Windowing:
Windowing is a mechanism which can affect congestion. There are two mechanisms for
implementing it. In GO back N multiple packets are repeated towards receiver in which
some are already received at receiver end. Due to this Congestion may happen, therefore
Selective repeat is better mechanism.

3. Packet dropping: it may be good discarding policy. It is better to discard a less


sensitive packet instead of more sensitive packet Router can maintain quality of service.
In case of video transmission router can discard less sensitive packet.

4. Admission control: A good admission control policy can minimize congestion.


Router in a network can first check resource requirement by incoming packet. Router can
deny for route for new node to prevent congestion.

5. Acknowledgment: Acknowledge are sent to confirm receiving of packet. These


acknowledge are also part of load in network. One acknowledgement for one packet may
increase load in network. Other approaches are applied to handle Congestion. one
acknowledgement for multiple packet or acknowledgement with data can be sent to
reduce load in network. Timer policy can be applied to send acknowledgement.

Detection and Removal Congestion Control (Closed loop): Remove the


congestion after it happened.

Once Congestion happens, detection and Removal Congestion Control technique is used
to remove Congestion. There are several techniques those used .Some of methods are
here.
 Backpressure:

In this technique upstream node is stopped by congested node by not receiving data.
When upstream node become congested it also rejects to above node. During this method
pressure goes to source node. Backpressure works in opposite direction. Backpressure
works well in virtual circuits where each node knows address of above upstream node.

Dept -CSE Page 12


MODULE -3 NETWORK LAYER

In above figure 3rd when node is congested, its ends pressure to 2nd node and then 2nd
node send pressure to first node. Finally, source node realized to reduce its speed.

 Choke Packet: Choke packet technique can be implemented in to both virtual


networks and datagram subnets. A special packet called choke packet is released to
source by congested node with information about congestion. Every router checks its
output line and resource utilization. When there is high utilization than threshold,
Congested router sent choke packet to source with warning message to intermediate
nodes.

 Implicit: No signal is transmitted between source node and congested node. When
there is no acknowledgement for while source guesses that there is congestion in a
network it must reduce traffic.

Explicit: If a node rely that congestion happens it send explicit signal to sender or receiver
about congestion. In choke packet a separate packet is created but in Explicit signaling
signal is included in data packet.

Forward Signaling: In this scheme a warning signal is sent to destination. Receiving node
can adopt policy to reduce signal.

Reverse Signaling:
 In this method a warning signal is sent to backward direction. The sending node is
warned. Source can reduce traffic after receiving signal.
 Conclusion-Both techniques have advantages and disadvantages. Closed loop
methods are better than open loop.

Dept -CSE Page 13


MODULE -3 NETWORK LAYER

IP ADDRESSES:
An IP address is the identifier that enables your device to send or receive data packets
across the internet. It holds information related to your location and therefore making
devices available for two-way communication. The internet requires a process to distinguish
between different networks, routers, and websites.

An IP address is represented by a series of numbers segregated by periods (.). They are


expressed in the form of four pairs - an example address might be 255.255.255.255 wherein
each set can range from 0 to 255.

IPv4:
IP stands for Internet Protocol and v4 stands for Version Four
(IPv4).IPv4wastheprimaryversion brought into action for production within the ARPANET
in 1983. IP version four addresses are 32-bit integers which will be expressed in decimal
notation. Example- 192.0.2.126 could be anIPv4address.
IP header includes much relevant information including Version Number, which, in this
context is 4. Other details are as follows–

Dept -CSE Page 14


MODULE -3 NETWORK LAYER

Version Version no. of Internet Protocol used(e.g.IPv4).


Internet Header Length; Length of entire IPheader.
IHL

DSCP Differentiated Services Code Point; this is Type of Service.

ECN Explicit Congestion Notification; It carries information about the congestion


seen in the route.
TotalLength Length of entire IP Packet (including IPheader and IP Payload).

Identification If IP packet is fragmented during the transmission, all the fragments contains an
identification number. To identify original IPpacket they belong to.
Flags As required by the network resources ,if IP Packet is too large to handle,
these‘flags’tells if theycan be fragmented ornot.Inthis3-bitflag,the MSB is
always set to ‘0’.
Fragment This offset tells the exact position of the fragment in the original IP Packet.
Offset
Time to Live To avoid looping in the network, every packet is sent with some TTL value set,
which tells the network how many routers (hops) this packet can cross. At each
hop, its value is decremented by one and when the value reaches zero, the packet
is discarded.
Protocol Tells the Network layer at the destination host, to which Protocol this packet
belongs to,
i.e. the next level Protocol. For example protocol number of ICMP is 1, TCP is 6
and UDP is 17.
Header This field is used to keep checksum value of entire header which is then used to
Checksum check if the packet is received error-free.
Source 32-bit address of the Sender (or source) of the packet.
Address
Destination 32-bit address of the Receiver (or destination) of the packet.
Address
Options This is optional field, which is used if the value of IHL is greater than 5. These
options may contain values for options such as Security, Record Route, Time
Stamp, etc.

Dept -CSE Page 15


MODULE -3 NETWORK LAYER

IPv6HeaderFormat:

Version(4-bits): ItrepresentstheversionofInternetProtocol,i.e.0110.
These8bitsaredividedintotwoparts.Themostsignificant6bitsareusedforTypeof
Traffic Class
(8-bits): ServicetolettheRouterKnownwhatservicesshouldbeprovidedtothispacket.Theleas
tsignificant2bitsareused for Explicit Congestion Notification (ECN).

Thislabelisusedtomaintainthesequentialflowofthepacketsbelongingtoacommunic
ation.Thesourcelabelsthesequencetohelptherouteridentifythata
Flow Label (20- particular packet belongs to a specific flow of information. This field helps
bits): avoid re- ordering of data packets. It is designed for streaming/real-time media.
Payload Length This field is used to tell the routers how much information a particular packet
(16-bits): contains in its payload. Payload is composed of Extension Headers and Upper
Layer data. With 16 bits, up to 65535 bytes can be indicated; but if the
Extension Headers contain Hop-by-Hop Extension Header, then the payload
may exceed 65535 bytes and this field is set to 0.
Next Header (8- This field is used to indicate either the type of Extension Header, or if the
bits): Extension Header is not present then it indicates the Upper Layer PDU. The
values for the type of Upper Layer PDU are same as IPv4’s.
Hop Limit (8-bits): This field is used to stop packet to loop in the network infinitely. This is same as
TTL in IPv4. The value of Hop Limit field is decremented by 1 as it passes a
link (router/hop). When the field reaches 0 the packet is discarded.
Source Address This field indicates the address of originator of the packet.
(128-bits)
Destination This field provides the address of intended recipient of the packet.
Address (128- bits):

Dept -CSE Page 16


MODULE -3 NETWORK LAYER

Difference between IPv4 and IPv6:

IPv4 IPv6

IPv4hasa32-bitaddresslength IPv6hasa128-bitaddresslength

It Supports Manual and DHCP address It supports Auto and renumbering address
configuration configuration

InIPv4endtoend,connectionintegri InIPv6endtoend,connectionintegrityisAchieva
tyisUnachievable ble

The Security feature is dependent on IPSECisaninbuiltsecurityfeatureintheIPv6protocol


application

AddressrepresentationofIPv4isindeci AddressRepresentationofIPv6isinhexadecimal
mal

Fragmentation performed by Sender InIPv6fragmentationperformedonlybythesender


and forwarding routers
In IPv4 Packet flow identification is In IPv6 packet flow identification are Available and
not available uses the flow label field in the header
In IPv4 checksum field is available In IPv6 checksum field is not available

It has broadcast Message Transmission In IPv6 multicast and any cast message transmission
Scheme scheme is available
In IPv4 Encryption and Authentication In IPv6 Encryption and Authentication are provided
facility not provided
IPv4 has a header of 20-60 bytes. IPv6 has header of 40 bytes fixed

Dept -CSE Page 17


MODULE -3 NETWORK LAYER

Internet Control Protocols:

A) ICMP (Internet Message Control Protocol):


The ICMP stands for Internet Control Message Protocol. It is a network layer protocol. It is used for error
handling in the network layer, and it is primarily used on network devices such as routers. As different
types of errors can exist in the network layer, so ICMP can be used to report these errors and to debug
those errors.

ICMP Message Format

The message format has two things; one is a category that tells us which type of message it is. If
the message is of error type, the error message contains the type and the code. The type defines
the type of message while the code defines the subtype of the message.

The ICMP message contains the following fields:

o Type: It is an 8-bit field. It defines the ICMP message type. The values range from 0 to
127 are defined for ICMPv6, and the values from 128 to 255 are the informational
messages.
o Code: It is an 8-bit field that defines the subtype of the ICMP message
o Checksum: It is a 16-bit field to detect whether the error exists in the message or not.

Dept -CSE Page 18


MODULE -3 NETWORK LAYER

B) ARP (Address Resolution Protocol)


ARP stands for Address Resolution Protocol, which is used to find the MAC address of the
device from its known IP address. This means, the source device already knows the IP address
but not the MAC address of the destination device.

The MAC address of the device is required because you cannot communicate with a device in a
local area network (Ethernet) without knowing its MAC address. So, the Address Resolution
Protocol helps to obtain the MAC address of the destination device.

C) RARP (Reverse Address Resolution Protocol)

Dept -CSE Page 19


MODULE -3 NETWORK LAYER

The Reverse Address Resolution Protocol (RARP) is a networking protocol that is used to map a
physical (MAC) address to an Internet Protocol (IP) address. It is the reverse of the more
commonly used Address Resolution Protocol (ARP), which maps an IP address to a MAC
address.

OPEN SHORTEST PATH FIRST

 The OSPF stands for Open Shortest Path First. It is a widely used and supported
routing protocol.
 It is an interdomain protocol, which means that it is used within an area or a network.
 It is an interior gateway protocol that has been designed within a single autonomous
system.
 It is based on a link-state routing algorithm in which each router contains the information
of every domain, and based on this information, it determines the shortest path.
 The OSPF achieves by learning about every router and subnet within the entire network.
 Every router contains the same information about the network. The way the router learns
this information by sending LSA (Link State Advertisements).

Dept -CSE Page 20


MODULE -3 NETWORK LAYER

OSPF AREAS

 OSPF divides the autonomous systems into areas where the area is a collection of
networks, hosts, and routers.
 Like internet service providers divide the internet into a different autonomous system for
easy management and OSPF further divides the autonomous systems into Areas.

There are four types of links in OSPF:

1. Point-to-point link: The point-to-point link directly connects the two routers without
any host or router in between.
2. Transient link: When several routers are attached in a network, they are known as a
transient link. The transient link has two different implementations:
1.Unrealistic topology: When all the routers are connected to each other, it is known as
unrealistic

2.Realistic topology: When some designated router exists in a network then it is known
as a realistic topology. Here designated router is a router to which all the routers are
connected. All the packets sent by the routers will be passed through the designated
router.
3. Stub link: It is a network that is connected to the single router. Data enters to the
network through the single router and leaves the network through the same router.

Dept -CSE Page 21


MODULE -3 NETWORK LAYER

4. Virtual link: If the link between the two routers is broken, the administration creates
the virtual path between the routers, and that path could be a long one also.

BORDER GATEWAY PROTOCOL

It is an interdomain routing protocol, and it uses the path-vector routing. It is a gateway protocol
that is used to exchange routing information among the autonomous system on the internet.

As we know that Border Gateway Protocol works on different autonomous systems, so we


should know the history of BGP, types of autonomous systems, etc.

BGP Autonomous Systems

An autonomous system is a collection of networks that comes under the single common
administrative domain. Or we can say that it is a collection of routers under the single
administrative domain.

For example, an organization can contain multiple routers having different locations, but the
single autonomous number system will recognize them. Within the same autonomous system or
same organization, we generally use IGP (Interior Gateway Protocol) protocols like RIP, IGRP,
EIGRP, and OSPF. Suppose we want to communicate between two autonomous systems. In that
case, we use EGP (Exterior Gateway Protocols).

The protocol that is running on the internet or used to communicate between two different
autonomous number systems is known as BGP (Border Gateway Protocol).

The BGP is the only protocol that is running on the internet backbone or used to exchange the
routes between two different autonomous number systems. Internet service providers use the
BGP protocol to control all the routing information.

Dept -CSE Page 22


MODULE -3 NETWORK LAYER

The following are the 3 categories

1. Stub autonomous system

It is a system that contains only one connection from one autonomous system to another
autonomous system. The data traffic cannot be passed through the stub autonomous system. The
Stub AS can be either a source or a sink. If we have one autonomous system, i.e., AS1, then it
will have a single connection to another autonomous system, AS2. The AS1 can act either as a
source or a sink. If it acts as a source, then the data moves from AS1 to AS2. If AS1 acts as a
sink, means that the data gets consumed in AS1 which is coming from AS2, but the data will not
move forward from AS1.

2. Multihomed/Multiconnected autonomous system

It is an autonomous system that can have more than one connection to another autonomous
system, but it can still be either a source or a sink for data traffic. There is no transient data
traffic flow, which means that the data can be passed from one autonomous system.

Dept -CSE Page 23


MODULE -3 NETWORK LAYER

3. Transient Autonomous System (network)

The transient autonomous system is a Multihomed autonomous system, but it also provides
transient traffic flow.

Dept -CSE Page 24


MODULE -3 NETWORK LAYER

MODULE 4

4.1 UDP Protocol


In computer networking, the UDP stands for User Datagram Protocol. The David P. Reed
developed the UDP protocol in 1980. It is defined in RFC 768, and it is a part of
the TCP/IP protocol, so it is a standard protocol over the internet. The UDP protocol allows the
computer applications to send the messages in the form of datagrams from one machine to
another machine over the Internet Protocol (IP) network.

UDP Header Format

The UDP header contains four fields:

o Source port number: It is 16-bit information that identifies which port is going t send
the packet.
o Destination port number: It identifies which port is going to accept the information. It
is 16-bit information which is used to identify application-level service on the destination
machine.
o Length: It is 16-bit field that specifies the entire length of the UDP packet that includes
the header also. The minimum value would be 8-byte as the size of the header is 8 bytes.
o Checksum: It is a 16-bits field, and it is an optional field. This checksum field checks
whether the information is accurate or not as there is the possibility that the information
can be corrupted while transmission.

Dept -CSE Page 25


MODULE -3 NETWORK LAYER

4.2 Remote Procedure Call (RPC):


A remote procedure call is an inter-process communication technique that is used for client-
server-based applications. It is also known as a subroutine call or a function call.
The sequence of events in a remote procedure call is given as follows −

 The client stub is called by the client.


 The client stub makes a system call to send the message to the server and puts the
parameters in the message.
 The message is sent from the client to the server by the client’s operating system.
 The message is passed to the server stub by the server operating system.
 The parameters are removed from the message by the server stub.
Then, the server procedure is called by the server stub.
A diagram that demonstrates this is as follows −

Advantages of Remote Procedure Call

 Remote procedure calls support process oriented and thread-oriented models.


 The internal message passing mechanism of RPC is hidden from the user.
 The effort to re-write and re-develop the code is minimum in remote procedure calls.
 Remote procedure calls can be used in distributed environment as well as the local
environment.
 Many of the protocol layers are omitted by RPC to improve performance.

Dept -CSE Page 26


MODULE -3 NETWORK LAYER

Disadvantages of Remote Procedure Call

 The remote procedure call is a concept that can be implemented in different ways. It is
not a standard.
 There is no flexibility in RPC for hardware architecture. It is only interaction based.
 There is an increase in costs because of remote procedure call.

Dept -CSE Page 27

You might also like