0% found this document useful (0 votes)
19 views27 pages

FON Unit III - IoT

Fundamental of networks or computer networks R22 regulation unit 3 notes

Uploaded by

tejaswi231008
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)
19 views27 pages

FON Unit III - IoT

Fundamental of networks or computer networks R22 regulation unit 3 notes

Uploaded by

tejaswi231008
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/ 27

UNIT-III

Network Layer Design Issues( VERY VERY IMPORTANT)


1. Store-and-forward packet switching
2. Services provided to transport layer
3. Implementation of connectionless service
4. Implementation of connection-oriented service
5. Comparison of virtual-circuit and datagram networks

1 Store-and-forward packet switching

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 ISP. The packet is stored there until it has fully arrived and the link
has finished its processing by verifying the checksum. 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.

2 Services provided to transport layer


The network layer provides services to the transport layer at the network layer/transport layer
interface. The services need to be carefully designed with the following goals in mind:
1. Services independent of router technology.
2. Transport layer shielded from number, type, topology of routers.
3. Network addresses available to transport layer use uniform numbering plan
– even across LANs and WANs

3 Implementation of connectionless service

If connectionless service is offered, packets are injected into the network individually and
routed independently of each other. No advance setup is needed. In this context, the packets
are frequently called datagrams (in analogy with telegrams) and the network is called a
datagram network.

A’s table (initially) A’s table (later) C’s Table E’s Table

Let us assume for this example that the message is four times longer than the maximum
packet size, so the network layer has to break it into four packets, 1, 2, 3, and 4, and send each
of them in turn to router A.
Every router has an internal table telling it where to send packets for each of the possible
destinations. Each table entry is a pair(destination and the outgoing line). Only directly
connected lines can be used.
A’s initial routing table is shown in the figure under the label ‘‘initially.’’
At A, packets 1, 2, and 3 are stored briefly, having arrived on the incoming link. Then each
packet is forwarded according to A’s table, onto the outgoing link to C within a new frame.
Packet 1 is then forwarded to E and then to F.
However, something different happens to packet 4. When it gets to A it is sent to router B,
even though it is also destined for F. For some reason (traffic jam along ACE path), A decided
to send packet 4 via a different route than that of the first three packets. Router A updated its
routing table, as shown under the label ‘‘later.’’
The algorithm that manages the tables and makes the routing decisions is called the routing
algorithm.
4 Implementation of connection-oriented service

A’s table C’s Table E’s Table

If connection-oriented service is used, a path from the source router all the way to the
destination router must be established before any data packets can be sent. This connection is
called a VC (virtual circuit), and the network is called a virtual-circuit network

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. When the connection is released, the virtual circuit is also
terminated. With connection-oriented service, each packet carries an identifier telling which
virtual circuit it belongs to.

As an example, consider the situation shown in Figure. Here, host H1 has established
connection 1 with host H2. This connection is remembered as the first entry in each of the
routing tables. The first line of A’s table says that if a packet bearing connection identifier 1
comes in from H1, it is to be sent to router C and given connection identifier 1. Similarly, the
first entry at C routes the packet to E, also with connection identifier 1.
Now let us consider what happens if H3 also wants to establish a connection to H2. It chooses
connection identifier 1 (because it is initiating the connection and this is its only connection)
and tells the network to establish the virtual circuit.
This leads to the second row in the tables. Note that we have a conflict here because although
A can easily distinguish connection 1 packets from H1 from connection 1 packets from H3, C
cannot do this. For this reason, A assigns a different connection identifier to the outgoing
traffic for the second connection. Avoiding conflicts of this kind is why routers need the ability
to replace connection identifiers in outgoing packets.
In some contexts, this process is called label switching. An example of a connection-oriented
network service is MPLS (Multi Protocol Label Switching).

5 Comparison of virtual-circuit and datagram networks

Routing Algorithms
The main function of NL (Network Layer) is routing packets from the source machine to the
destination machine.
There are two processes inside router:
a) One of them handles each packet as it arrives, looking up the outgoing line to use for it in
the routing table. This process is forwarding.
b) The other process is responsible for filling in and updating the routing tables. That is where
the routing algorithm comes into play. This process is routing.

Regardless of whether routes are chosen independently for each packet or only when new
connections are established, certain properties are desirable in a routing algorithm
correctness, simplicity, robustness, stability, fairness, optimality
Routing algorithms can be grouped into two major classes:
1) nonadaptive (Static Routing)
2) adaptive. (Dynamic Routing)

Nonadaptive algorithm do not base their routing decisions on measurements or estimates of


the current traffic and topology. Instead, the choice of the route to use to get from I to J is
computed in advance, off line, and downloaded to the routers when the network is booted.
This procedure is sometimes called static routing.

Adaptive algorithm, in contrast, change their routing decisions to reflect changes in the
topology, and usually the traffic as well.
Adaptive algorithms differ in
1) Where they get their information (e.g., locally, from adjacent routers, or from all routers),
2) When they change the routes (e.g., every ∆T sec, when the load changes or when the
topology changes), and
3) What metric is used for optimization (e.g., distance, number of hops, or estimated transit
time).
This procedure is called dynamic routing

Different Routing Algorithms


• Optimality principle
• Shortest path algorithm
• Flooding
• Distance vector routing
• Link state routing
• Hierarchical Routing

The Optimality Principle


One can make a general statement about optimal routes without regard to network topology
or traffic. This statement is known as the optimality principle.
It states that if router J is on the optimal path from router I to router K, then the optimal
path from J to K also falls along the same
As a direct consequence of the optimality principle, we can see that the set of optimal routes
from all sources to a given destination form a tree rooted at the destination. Such a tree is
called a sink tree. The goal of all routing algorithms is to discover and use the sink trees for all
routers
(a) A network. (b) A sink tree for router B.
Shortest Path Routing (Dijkstra’s)(very very important)
The idea is to build a graph of the subnet, with each node of the graph representing a router
and each arc of the graph representing a communication line or link.
To choose a route between a given pair of routers, the algorithm just finds the shortest path
between them on the graph
1. Start with the local node (router) as the root of the tree. Assign a cost of 0 to this node and
make it the first permanent node.
2. Examine each neighbor of the node that was the last permanent node.
3. Assign a cumulative cost to each node and make it tentative
4. Among the list of tentative nodes
a. Find the node with the smallest cost and make it Permanent
b. If a node can be reached from more than one route then select the route with the
shortest cumulative cost.
5. Repeat steps 2 to 4 until every node becomes permanent
Flooding
• Another static algorithm is flooding, in which 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.
• 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. Ideally, the hop counter should be initialized
to the length of the path from source to destination.
• A variation of flooding that is slightly more practical is
selective flooding. In this algorithm the routers do not send
every incoming packet out on every line, only on those lines
that are going approximately in the right direction.
• Flooding is not practical in most applications.
Distance Vector Routing:( very very important)
A distance vector routing algorithm operates by having each router maintain a table (i.e., a
vector) giving the best known distance to each destination and which link to use to get there.
These tables are updated by exchanging information
with the neighbors. In distance vector routing, each router maintains a routing table indexed
by, and containing one entry for each router in the network. This entry has two parts: the
preferred outgoing line to use for that destination and an estimate of the distance to that
destination. The distance might be measured as the number of hops or using another metric.
This updating process is illustrated in Fig. 5-9. Part (a) shows a
network. The first four columns of part (b) show the delay vectors
received from the neighbors of router J. A claims to have a 12-msec
delay to B, a 25-msec delay to C, a 40- msec delay to D, etc. Suppose
that J has measured or estimated its delay to its neighbors, A, I, H, and
K, as 8, 10, 12, and 6 msec, respectively.

New estimated
Router delay from J
A B C D To A I H K Line
A 0 24 20 21 8
B 12 36 31 28 20
C 25 18 19 36 28
F G D 40 27 8 24 20
E H
E 14 7 30 22 17
F 23 20 19 40 30
G 18 31 6 31 18
H 17 20 0 19 12
I J K L 21 0 14 22 10
I
J 9 11 7 10 0
K 24 22 22 0 6 K
L 29 33 9 9 15 K
JA JI JH JK
delay delay delay delay New
is is is is routing
8 10 12 6 table
for J
Vectors received from
J's four neighbors
(a) (b)

Figure 5-9. (a) A network. (b) Input from A, I, H, K, and the new routing table for J.

Consider how J computes its new route to router G. It knows that


it can get to A in 8 msec, and furthermore A claims to be able to get
to G in 18 msec, so J knows it can count on a delay of 26 msec to G
if it forwards packets bound for G
to A. Similarly, it computes the delay to G via I, H, and K as 41
(31 + 10), 18 (6 + 12), and 37 (31 + 6) msec, respectively. The best of
these values is 18, so it makes an entry in its routing table that the
delay to G is 18 msec and that the route to use is via H. The same
calculation is performed for all the other destinations, with the new
routing table shown in the last column of the figure.

The Count-to-Infinity Problem


The settling of routes to best paths across the network is called
convergence. Distance vector routing is useful as a simple technique
by which routers can col- lectively compute shortest paths, but it has a
serious drawback in practice: al- though it converges to the correct
answer, it may do so slowly. In particular, it reacts rapidly to good
news, but leisurely to bad news. Consider a router whose best route to
destination X is long. If, on the next exchange, neighbor A suddenly
reports a short delay to X, the router just switches over to using the
line to A to send traffic to X. In one vector exchange, the good news
is processed.
To see how fast good news propagates, consider the five-node
(linear) net- work of Fig. 5-10, where the delay metric is the number
of hops. Suppose A is down initially and all the other routers know
this. In other words, they have all recorded the delay to A as infinity.
A B C D E A B C D E
   Initially 1 2 3 4 Initially
1   After 1 exchange 3 2 3 4 After 1 exchange
1 2  After 2 exchanges 3 4 3 4 After 2 exchanges
1 2 3 After 3 exchanges 5 4 5 4 After 3 exchanges
1 2 3 4 After 4 exchanges 5 6 5 6 After 4 exchanges
7 6 7 6 After 5 exchanges
7 8 7 8 After 6 exchanges
.
 .  
(a) (b)

Figure 5-10. The count-to-infinity problem.

When A comes up, the other routers learn about it via the vector
exchanges. For simplicity, we will assume that there is a gigantic gong
somewhere that is struck periodically to initiate a vector exchange at all
routers simultaneously. At the time of the first exchange, B learns that its
left-hand neighbor has zero delay to A. B now makes an entry in its
routing table indicating that A is one hop away to the left. All the other
routers still think that A is down. At this point, the rout- ing table entries
for A are as shown in the second row of Fig. 5-10(a). On the next
exchange, C learns that B has a path of length 1 to A, so it updates its
routing table to indicate a path of length 2, but D and E do not hear the
good news until later. Clearly, the good news is spreading at the rate of one
hop per exchange. In a net- work whose longest path is of length N hops,
within N exchanges everyone will know about newly revived links and
routers.
Now let us consider the situation of Fig. 5-10(b), in which all the links
and routers are initially up. Routers B, C, D, and E have distances to A of
1, 2, 3, and 4 hops, respectively. Suddenly, either A goes down or the link
between A and B is cut (which is effectively the same thing from B’s point
of view).
At the first packet exchange, B does not hear anything from A.
Fortunately, C says ‘‘Do not worry; I have a path to A of length 2.’’ Little
does B suspect that C’s path runs through B itself. For all B knows, C might
have ten links all with sepa- rate paths to A of length 2. As a result, B thinks
it can reach A via C, with a path length of 3. D and E do not update their
entries for A on the first exchange.
On the second exchange, C notices that each of its neighbors claims to
have a path to A of length 3. It picks one of them at random and makes its
new distance to A 4, as shown in the third row of Fig. 5-10(b). Subsequent
exchanges produce the history shown in the rest of Fig. 5-10(b).
From this figure, it should be clear why bad news travels slowly: no
router ever has a value more than one higher than the minimum of all its
neighbors. Gradually, all routers work their way up to infinity, but the
number of exchanges required depends on the numerical value used for
infinity. For this reason, it is wise to set infinity to the longest path plus 1.
Not entirely surprisingly, this problem is known as the count-to-infinity prob-lem.
Hierarchical Routing:As networks grow in size, the router routing
tables grow proportionally. Not only is router memory consumed by ever-increasing
tables, but more CPU time is needed to scan them and more bandwidth is needed to
send status reports about them. At a certain point, the network may grow to the point
where it is no longer feasible for every router to have an entry for every other router,
so the routing will have to be done hierarchically, as it is in the telephone network.
When hierarchical routing is used, the routers are divided into what we
will call regions. Each router knows all the details about how to route
packets to dest- inations within its own region but knows nothing about the
internal structure of other regions. When different networks are
interconnected, it is natural to regard each one as a separate region to free
the routers in one network from having to know the topological structure of
the other ones.For huge networks, a two-level hierarchy may be
insufficient; it may be nec- essary to group the regions into clusters, the
clusters into zones, the zones into groups, and so on.
Figure 5-14 gives a quantitative example of routing in a two-level hierarchy
with five regions. The full routing table for router 1A has 17 entries, as
shown in Fig. 5-14(b). When routing is done hierarchically, as in Fig. 5-
14(c), there are en- tries for all the local routers, as before, but all other
regions are condensed into a single router, so all traffic for region 2 goes via
the 1B-2A line, but the rest of the remote traffic goes via the 1C-3B line.
Hierarchical routing has reduced the table from 17 to 7 entries. As the ratio
of the number of regions to the number of rout- ers per region grows, the
savings in table space increase.
Full table for 1A Hierarchical table for 1A
Dest. Line Hops Dest. Line Hops
Region 1 Region 2 1A – – 1A – –
1B 2A 2B 1B 1B 1 1B 1B 1
1C 1C 1 1C 1C 1
1A
2A 1B 2 2 1B 2
1C 2C 2D
2B 1B 3 3 1C 2
2C 1B 3 4 1C 3
2D 1B 4 5 1C 4
4A 5B 5C 3A 1C 3
3A
5A 3B 1C 2
3B 4B 4C 5D 4A 1C 3
5E
4B 1C 4
Region 3 Region 4 Region 5
4C 1C 4
5A 1C 4
5B 1C 5
5C 1B 5
5D 1C 6
5E 1C 5
(a) (b) (a)
Figure 5-14. Hierarchical routing.

Broadcast Routing
In some applications, hosts need to send messages to many
or all other hosts. Sending a packet to all destinations
simultaneously is called broadcasting. Various methods have
been proposed for doing it.
One broadcasting method that requires no special features from the network is for
the source to simply send a distinct packet to each destination.
multidestination routing, in which each packet contains either a list of destinations
or a bit map indicating the desired destinations. When a packet arrives at a router,
the router checks all the destinations to determine the set of output lines that will
be needed.
flooding. When implemented with a sequence number per source, flooding uses
links efficiently with a decision rule at routers that is relatively simple.
reverse path forwarding: When a broadcast packet ar- rives at a router, the router
checks to see if the packet arrived on the link that is normally used for sending
packets toward the source of the broadcast. If so, there is an excellent chance that
the broadcast packet itself followed the best route from the router.
B C B C I
A D A D
F E F F H J N
E
I G I G
A D E K G O M O
J J
H N H L
L N E C G D N K
O O
K K
H B L H
M M
L B

(a) (b) (c)

Figure 5-15. Reverse path forwarding. (a) A network. (b) A sink tree.
(c) The tree built by reverse path forwarding.

An example of reverse path forwarding is shown in Fig. 5-


15. Part (a) shows a network, part (b) shows a sink tree for
router I of that network, and part (c) shows how the reverse
path algorithm works. On the first hop, I sends packets to F,
H, J, and N, as indicated by the second row of the tree. Each
of these packets arrives on the preferred path to I (assuming
that the preferred path falls along the sink tree) and is so
indicated by a circle around the letter. On the second hop,
eight packets are generated, two by each of the routers that
received a packet on the first hop. As it turns out, all eight of
these arrive at previously unvisited rout- ers, and five of
these arrive along the preferred line. Of the six packets
generated on the third hop, only three arrive on the preferred
path (at C, E, and K); the oth- ers are duplicates. After five
hops and 24 packets, the broadcasting terminates, compared
with four hops and 14 packets had the sink tree been
followed exactly.
A spanning tree is a subset of the network that includes all
the routers but contains no loops. Sink trees are spanning
trees. If each router knows which of its lines belong to the
spanning tree, it can copy an incoming broadcast packet onto
all the spanning tree lines except the one it arrived on.

Multicast Routing
Some applications, such as a multiplayer game or live video of a sports event
streamed to many viewing locations, send packets to multiple receivers.
Sending a message to such a group is called multicasting, and the routing al-
gorithm used is called multicast routing. All multicasting schemes require some
way to create and destroy groups and to identify which routers are members of a
group.
As an example, consider the two groups, 1 and 2, in the
network shown in Fig. 5-16(a). Some routers are attached to
hosts that belong to one or both of these groups, as indicated
in the figure. A spanning tree for the leftmost router is shown
in Fig. 5-16(b). This tree can be used for broadcast but is
overkill for mu- lticast, as can be seen from the two
pruned versions that are shown next. In Fig. 5-16(c), all the
links that do not lead to hosts that are members of group 1
have been removed. The result is the multicast spanning tree
for the leftmost router to send to group 1. Packets are
forwarded only along this spanning tree, which is more
efficient than the broadcast tree because there are 7 links
instead of
10. Fig. 5-16(d) shows the multicast spanning tree after pruning for group
2. It is efficient too, with only five links this time. It also shows that
different multicast groups have different spanning trees.
2 1 2 1

1, 2 1, 2
1, 2
1, 2 2
2 2 2

1
1
1
1
(a) (b)
1

1 2
1 2 2 2

1
1
(c) (d)

Figure 5-16. (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.

CONGESTION AND QUALITY OF SERVICE(QOS) IN A NETWORK

Congestion: It occurs in a network when load of a network is greater than capacity of the network.
Congestion Control Techniques or Policies: (VERY VERY IMPORTANT)
These techniques or policies are used prevent the congestion before it happens or remove the congestion after it happens.
These techniques are two types
1)Open loop congestion control techniques
2)Closed loop congestion control techniques

Open loop congestion control techniques:


These techniques or policies are used prevent the congestion before it happens
The policies are
1)Retransmission policy
2)window policy
3) Acknowledgement policy
4)Discarding policy

1)Retransmision policy: packet or data or acknowledgement is sent when it is lost or damaged.Generaaly it leads to more load or
congestion on a network.but good transmission policy available in TCP reduces the congestion.
2)Window policy: Selective repeat protocol has good window policy than GOBACKN.In GOBACK N if one frame is lost all the
subsequent successful frames need to be transmitted again where as in the selective repeat only the lost frame retransmitted.
3)Acknowledgement Policy: good acknowledgement policy prevents the congestion.This is possible in 2 ways.
a)send acknowledgement for all the frames atba time with single message.
b)send the acknowledgement only when receiver has the data to send.
4.Discarding Policy:
Good discarding policy also prevents the congestion.In audio transmission applications sensitive or corrupted packets will be
discarded by the routers with out affecting the quality of sound.

Closed loop congestion control techniques:

These techniques or policies are used remove the congestion after it happens
The policies are
1) Back pressure
2) Choke packet
3) Implicit Signaling
4) Explicit Signaling

1)Back Pressure(BP):
Assume that data is flowing from source to destination.
source
destin
ation
Bp bp bp bp

Node 1 Node 2 Node 3 Node 4

Congested node

Data flow

Suppose node3 is congested then it stops receiving the data from its immediate upstream node.so node 2 is congested ,it also follow the
same till source node is congested.finally source node slows down the sending data to remove the congestion.
In backpressure nodes between congested node and source node affected due to congestion.

3)choke packet:
Assume that data is flowing from source to destination.

source chokepacket destin


ation

Node 1 Node 2 Node 3 Node 4

Congested node

Data flow

Suppose node3 is congested then it sends a special packet called choke packet directly to source node. node 2 is simply forwards the
choke packet,similary other nodes alos.This process will be continued till it reaches to l source node .Finally source node slows down
the sending data to remove the congestion.
In choke packet nodes between congested node and source node not affected due to congestion.

Hop-by-Hop
Choke Packets

(a) A choke packet that


affects only the source.

(b) A choke packet that


affects each hop it
passes through.
3)Implicit signaling:
It is also called LOAD SHEDDING.
In this no communication between source and congestion node. Source node guesses that congestion occurred in the network
based on some symptoms.
For example sender sends the data and wait for acknowledgement for a while.If it does not receive the acknowledgement with
in the time simply it slows down sending the data or packets by assuming congestion occurred.

4)Explicit Signaling:

Assume that data is flowing from source to destination.

source Special bit destin


with data ation

Node 1 Node 2 Node 3 Node 4

Congested node

Data flow

Suppose node3 is congested then it sends a special signal in the form of bit directly to source node.This sepecial bit will be sent along
with the data packet. Node 2 is simply forwards the choke packet,similary other nodes alos.This process will be continued till it reaches
to l source node .Finally source node slows down the sending data to remove the congestion.
In choke packet nodes between congested node and source node not affected due to congestion.

Quality of Service:
Four characteristics determine the quality of service of a data.They are
1)Reliability: network should transfer the data or acknowledgement without lost.
2)delay: application like audio ,video transmissions require minimum delay than applications like file transfer and e mail applications.
3)Jitter: variation in packet’s delay is called jitter or jitter control.
For example if four packets depart at times 0,1,2,3 and arrive at times 20,21,22,23 then delay respectively 20-0,21-1,22-2,23-3.
Suppose the arrival time is 25,28,21,29 then delay respectively 25-0,28-21,21-2,29-3. The variation in packet’s delay is called jitter.
Min jitter is required for audio,video applications.

4)Bandwidth:
High bandwidth required for applications like audio,video transmission to transfer millions of bits per second to refresh the screen.
Low bandwidth required for email transmission.

Traffic Shaping:( very very important)


• traffic shaping, is a technique, which smooths out the traffic on the server side, rather than on the client side.
• Traffic shaping controls the rate at which packets are sent .
• Two traffic shaping algorithms are:
a)Leaky Bucket
b)Token Bucket

The Leaky Bucket Algorithm:


• Conceptually, each host is connected to the network by an interface containing a leaky bucket, that is, a finite internal queue. If
a packet arrives at the queue when it is full, the packet is discarded.
• The Leaky Bucket Algorithm used to control rate in a network.
The Leaky Bucket Algorithm

34
(a) A leaky bucket with water. (b) a leaky bucket with packets.
The leaky bucket enforces a constant output rate (average rate) regardless of the burstiness of the input
• The host injects one packet per clock tick onto the network. This results in a uniform flow of packets, smoothing out bursts and
reducing congestion.
• Implementing the original leaky bucket algorithm is easy. The leaky bucket consists of a finite queue. When a packet arrives, if
there is room on the queue it is appended to the queue; otherwise, it is discarded. At every clock tick, one packet is transmitted
(unless the queue is empty).

Token Bucket Algorithm:

• In contrast to the LB, the Token Bucket Algorithm, allows the output rate to vary, depending on the size of the burst.
• In the TB algorithm, the bucket holds tokens. To transmit a packet, the host must capture and destroy one token.
• Tokens are generated by a clock at the rate of one token every t sec.
• Idle hosts can capture and save up tokens (up to the max. size of the bucket) in order to send larger bursts later.

The Token Bucket Algorithm

5-34

(a) Before. (b) After. 37


Internetworking Devices:
1. Repeater – A repeater operates at the physical layer. Its job is to regenerate the signal over the same network
before the signal becomes too weak or corrupted so as to extend the length to which the signal can be
transmitted over the same network.

2. Hub – A hub is basically a multiport repeater. A hub connects multiple wires coming from different branches,
for example, the connector in star topology which connects different stations. Hubs cannot filter data, so data
packets are sent to all connected devices. They do not have intelligence to find out best path for data packets
which leads to inefficiencies and wastage.

3. Bridge – A bridge operates at data link layer. A bridge is a repeater, with add on functionality of filtering content by
reading the MAC addresses of source and destination. It is also used for interconnecting two LANs working on the same
protocol. It has a single input and single output port.
4. Switch – A switch is a multi port bridge with a buffer and a design that can boost its efficiency(large number of ports
imply less traffic) and performance. Switch is data link layer device. Switch can perform error checking before forwarding
data, that makes it very efficient as it does not forward packets that have errors and forward good packets selectively to
correct port only.
5. Routers – A router is a device like a switch that routes data packets based on their IP addresses. Router is mainly a
Network Layer device. Routers normally connect LANs and WANs together and have a dynamically updating routing table
based on which they make decisions on routing the data packets.
6. Gateway – A gateway, as the name suggests, is a passage to connect two networks together that may work upon
different networking models. They basically works as the messenger agents that take data from one system, interpret it,
and transfer it to another system. Gateways are also called protocol converters and can operate at any network layer.
Gateways are generally more complex than switch or router.

Tunneling:
A technique of internetworking called Tunneling is used when source and destination networks of same type are to be
connected through a network of different type. For example, let us consider an Ethernet to be connected to another Etherne t
through a WAN as:

The task is sent on an IP packet from host A of Ethernet-1 to the host B of ethernet-2 via a WAN.
Sequence of events:

1. Host A construct a packet which contains the IP address of Host B.


2. It then inserts this IP packet into an Ethernet frame and this frame is addressed to the multiprotocol router M1
3. Host A then puts this frame on Ethernet.
4. When M1 receives this frame, it removes the IP packet, inserts it in the payload packet of the WAN network layer
packet and addresses the WAN packet to M2. The multiprotocol router M2 removes the IP packet and send it to host B in
an Ethernet frame.

Fragmentation:
Different networks have different capacity of processing the packets. Small capacity networks cannot process large packets.
Divide the large packets into small packets is called fragmentation. Two strategies used for fragmentation.
1)Transparent Fragmentation: In this large packet is divided in to small packets at the entry gateway of the
network and reassembled or merged or combined at the exit gateway of the network. The same process is
continued in all networks.
2)Non Transparent Fragmentation: In this large packet is divided in to small packets only at the entry
gateway of the first network and reassembled or merged or combined only at the destination. The same process
is continued in all networks.

Fragmentation

(a) Transparent fragmentation. (b) Nontransparent fragmentation.

The Network Layer in the Internet:


The Internet is an interconnected collection of many networks.
The network layer uses IP protocol to transmit the data grams .IP is unreliable,connectionless protocol.
There are 2 versions of IP.IP v4,IP v6
IP (internet protocol):
This contains min 20 bytes or max 60 bytes of header and variable size of data

The Internet Protocol(IP)

The IPv4 (Internet Protocol) header.

• The Version field keeps track of which version of the protocol


• IHL, is provided to tell how long the header is, in 32-bit words along with options
• The Type of service field is to distinguish between different classes of service.
• The Total length includes everything in the datagram—both header and data.
• The Identification field is needed. All the fragments of a datagram contain the same Identification value.
• 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.
• MF stands for More Fragments. All fragments except the last one have this bit set.
• The Fragment offset tells where in the current datagram this fragment belongs.
• The Time to live field is a counter used to limit packet lifetimes.
• The Protocol field tells it which transport process to give it to. TCP is one possibility, but so are UDP and some
others.
• The Header checksum verifies the header only. Such a checksum is useful for detecting errors.
• The Source address and Destination address indicate the network number and host number.
• The options are variable length.
IP addresses:
IP Addresses

IP address formats.

IP Addresses ….

Special IP addresses.

ICMP(INTERNET CONTROLMESSAGE PROTOCOL):


Internet Control Message Protocol

5-61

The principal ICMP message types.

ARP:
Address Resolution Protocol is important for changing the higher-level protocol address (IP addresses) to physical network addresses.
It is described in RFC 826.

ARP relates an IP address with the physical address. On a typical physical network such as LAN, each device on a link is identified by
a physical address, usually printed on the network interface card (NIC). A physical address can be changed easily when NIC on a
particular machine fails.
When one host wants to communicate with another host on the network, it needs to resolve the IP address of each host to the host's
hardware address.
This process is as follows−

 When a host tries to interact with another host, an ARP request is initiated. If the IP address is for the local network, the source
host checks its ARP cache to find out the hardware address of the destination computer.
 If the correspondence hardware address is not found, ARP broadcasts the request to all the local hosts.
 All hosts receive the broadcast and check their own IP address. If no match is discovered, the request is ignored.
 The destination host that finds the matching IP address sends an ARP reply to the source host along with its hardware
address, thus establishing the communication. The ARP cache is then updated with the hardware address of the destination
host.

RARP(REVERSE ADDRESS RESOLUTION PROTOCOL):


This protocol used to find IP Address of a host when MAC address is known.This is used to resolve IP address to MAC address .
It works similar to ARP but not in reverse process.

Subnetting:
If an organization has a large network,it is better to divide the network.The process of dividing the large network into small networks is
called subnetting.
Advantages of subnetting:
1) Reduces the network traffic
2) Increases the network performance
3) Increases the security in the network
4) Maintenance of the network is easy.
Allow a single network address to span multiple physical networks is called subnet addressing.
For subnet address scheme to work, one should know which part of id address is used as subnet address.To accomplish this
Subnet mask is used.
The network administrator creates 32 bit subnet mask which contains 1’s and 0’s.1’s indicate network address or subnet address
and 0’s indicate host address.
class B IP address ,the format is
Bits 8 8 8 8

Network id Networked Host id Host id

Means

11111111 11111111 00000000 00000000

So the subnet mask address for CLASS B is 255.255.0.0


The default subnet mask of IP addresses

Class IP Address format Default subnet mask address

A Networkid.hostid.hostid.hostid
. .
11111111 00000000.00000000 00000000

(255.0.0)

B Networkid.networkidid.hostid.hostid 11111111.1111111.00000000.00000000
(255.255.0.0)

C Networkid.networkidid.networkid.hostid 11111111.1111111.11111111.00000000
(255.255.255.0)

Masking:

The process of extracting subnet address from IP address is called Masking.


To find the subnet address ,two methods are used
a) Boundary level masking
b) Non boundary level masking
a) In this mask no is either 0 or 255.
If mask no is 255 in the mask address then IP address is repeated in the subnet address.
If mask no is 0(zero) in the mask address then 0 (zero) is repeated in the subnet address.
b) In this mask no is >0 & <255 but not either 0(zero) or 255.
For this masking ,BITWISE AND operation is performed b/w mask no and IP address.
Ex:
Find out subnet address for the following
IP Address mask address
a) 141.181.14.16 255.255.224.0
b) 200.34.22.156 255.255.255.240
c) 125.35.12.57 255.255.0.0
Solution:
a) IP Address : 141.181.14.16
Mask: 255.255.224.0
_______________________
Subnet address: 141.181.14&224.0
14&224
Binary equivalents of 14 ,224
14: 0000 1110
224 : 01110 0000
___________________
14&224: 0000 0000
So the subnet address is 141.181.0.0

b) IP Address : 200.34.22.156
Mask: 255.255.255.240
_______________________
Subnet address: 200.34.22.156&240
Bitwise And operation b/w 156 &240
Binary equivalents of 156 ,240
156: 1001 1100
240 : 1111 0000
___________________
156&240: 1001 0000  144

So the subnet address is 200.34.22.144

c)
IP Address : 125.35.12.57
Mask: 255.255.0.0
_______________________
Subnet address: 125.35.0.0

You might also like