Wednesday 30 January 2013

datagram


datagram 



In the datagram approach, each packet is treated independently, with no reference
to packets that have gone before. This approach is illustrated in Figure 3.7. Each node
chooses the next node on a packet's path, taking into account information received from
neighboring nodes on traffic, line failures, and so on. So the packets, each with the same
destination address, do not all follow the same route (c), and they may arrive out of
sequence at the exit point (d). In this example, the exit node restores the packets to their
original order before delivering them to the destination (e). In some datagram networks,
it is up to the destination rather than the exit node to do the reordering. Also, it is
possible for a packet to be destroyed in the network. For example, if a packet-switching
node crashes momentarily, all of its queued packets may be lost. Again, it is up to either
the exit node or the destination to detect the loss of a packet and decide how to recover
it. In this technique, each packet, treated independently, is referred to as a datagram.
In the virtual circuit approach, a preplanned route is established before any
packets are sent. Once the route is established, all the packets between a pair of
communicating parties follow this same route through the network. This is illustrated
in Figure 3.8. Because the route is fixed for the duration of the logical connection,
it is somewhat similar to a circuit in a circuit-switching network and is referred
to as a virtual circuit. Each packet contains a virtual circuit identifier as well as data.
Each node on the preestablished route knows where to direct such packets; no routing
decisions are required. At any time, each station can have more than one virtual
circuit to any other station and can have virtual circuits to more than one station.
So the main characteristic of the virtual circuit technique is that a route
between stations is set up prior to data transfer. Note that this does not mean that
this is a dedicated path, as in circuit switching. A packet is still buffered at each node
and queued for output over a line. The difference from the datagram approach is
that, with virtual circuits, the node need not make a routing decision for each
packet. It is made only once for all packets using that virtual circuit.
If two stations wish to exchange data over an extended period of time, there
are certain advantages to virtual circuits. First, the network may provide services
related to the virtual circuit, including sequencing and error control. Sequencing
refers to the fact that, because all packets follow the same route, they arrive in the
original order. Error control is a service that assures not only that packets arrive in
proper sequence, but also that all packets arrive correctly. For example, if a packet in
a sequence from node 4 to node 6 fails to arrive at node 6, or arrives with an error,
node 6 can request a retransmission of that packet from node 4 (Figure 3.3). Another
advantage is that packets should transit the network more rapidly with a virtual circuit;
it is not necessary to make a routing decision for each packet at each node.
One advantage of the datagram approach is that the call setup phase is
avoided. Thus, if a station wishes to send only one or a few packets, datagram delivery
will be quicker. Another advantage of the datagram service is that, because it is
more primitive, it is more flexible. For example, if congestion develops in one part of
the network, incoming datagrams can be routed away from the congestion. With the
use of virtual circuits, packets follow a predefined route, and thus it is more difficult
for the network to adapt to congestion. A third advantage is that datagram delivery
is inherently more reliable. With the use of virtual circuits, if a node fails, all virtual
circuits that pass through that node are lost. With datagram delivery, if a node fails,
subsequent packets may find an alternate route that bypasses that node.

No comments:

Post a Comment