Professional Documents
Culture Documents
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.
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.
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.
• The network layer provides service its immediate upper layer, namely transport layer,
through the network − transport layer interface.
• 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.
• 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.
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.
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 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 -
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.
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).
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:
1A - -
1B 1B 1
1C 1C 1
2A 1B 2
2B 1B 3
2C 1B 3
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 −
1A - -
1B 1B 1
1C 1C 1
2 1B 2
3 1C 2
4 1C 3
5 1C 4
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)
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.
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.
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.
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.
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.
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.
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–
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.
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):
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
AddressrepresentationofIPv4isindeci AddressRepresentationofIPv6isinhexadecimal
mal
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
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
The transient autonomous system is a Multihomed autonomous system, but it also provides
transient traffic flow.
MODULE 4
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.
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.