Datagram Approach: Connectionless Service

 

Datagram Approach: Connectionless Service

The datagram approach is a connectionless packet-switching approach used at the network layer. In this approach, the network layer treats each packet independently. Packets belonging to the same message have no relationship with one another from the network layer's point of view.

The Internet was originally designed around this connectionless service to keep the network simple.


1. Basic Idea

Suppose a sender wants to send a message consisting of four packets:

Message
   ↓
┌────┬────┬────┬────┐
│ P1 │ P2 │ P3 │ P4 │
└────┴────┴────┴────┘

In a datagram network, each packet is treated as an independent entity.

Therefore, the packets may travel through:

  • the same path, or
  • different paths

to reach the destination.

For example:

             R1 ── R3 ── R4
            /             \
Sender ─── R2              ─── Receiver
            \             /
             R5 ─────────

Packet 1 may take one route, while packet 2 may take another route.


2. No Connection Is Established

The word connectionless means that the network layer does not establish a connection or logical path before sending packets.

There is no separate:

Connection establishment
        ↓
Data transfer
        ↓
Connection termination

Instead, a packet can be sent immediately.

Each packet is independently forwarded toward its destination.


3. Each Packet Is Independent

This is the most important characteristic of the datagram approach.

Suppose a message contains:

P1   P2   P3   P4

The network layer does not consider these packets as belonging to one common connection.

For example:

P1 → Route A
P2 → Route B
P3 → Route A
P4 → Route C

Consequently, the packets may arrive:

P1 → P3 → P4 → P2

That means packets may arrive out of order.

The network layer itself does not attempt to establish a relationship between them.


4. Routers in a Datagram Network

The switching devices used in a datagram network are called routers.

When a packet arrives at a router, the router examines the information in the packet header and determines where to forward it.

The important addresses are:

  • Source address – identifies where the packet came from.
  • Destination address – identifies where the packet is going.

For example:

┌──────────────────────────────┐
│ Source Address      : A      │
│ Destination Address : B      │
│ Data                         │
└──────────────────────────────┘

The router primarily uses the destination address to make its forwarding decision.


5. Role of Source and Destination Addresses

Destination address

The destination address tells the router where the packet should ultimately go.

The router uses this address to determine the appropriate next hop/output interface.

Source address

The source address identifies the sender.

The source address may also be used when the router needs to send an error message back to the source, for example, if the packet is discarded.

Thus:

AddressMain purpose
Destination addressDetermines where the packet should go
Source addressIdentifies where the packet came from

6. Routing of Packets

Consider four packets belonging to one message:

        P1 ───────────────→
        P2 ────────→
Sender                  Receiver
        P3 ──────────────→
        P4 ───────→

Each packet is routed independently.

A router does not necessarily remember:

"Packet P1 came through this path, so P2 should follow the same path."

Instead, when each packet arrives, the router examines its destination address and makes a forwarding decision for that packet.

Therefore:

Packet 1 → independently routed
Packet 2 → independently routed
Packet 3 → independently routed
Packet 4 → independently routed






7. Packets from Different Messages

Another important characteristic is that packets from different messages or different sources can be mixed together.

For example, a router may receive:

Packet from Message A
        ↓
Packet from Message B
        ↓
Packet from Message A
        ↓
Packet from Message C

The router does not need to maintain a separate connection for each message.

It simply examines each packet and forwards it according to its destination address.


8. Out-of-Order Delivery

Because packets are independently routed, they can experience different delays.

For example:

Sender                         Receiver

P1 ────────────────→              P1
P2 ────────→                       P3
P3 ─────────────→                  P4
P4 ───────────→                    P2

The packets may arrive as:

P1, P3, P4, P2

rather than:

P1, P2, P3, P4

The figure in the textbook specifically illustrates this possibility of out-of-order delivery.


9. Advantages of Datagram Approach

1. Simple

There is no need to establish or maintain a connection before transmitting packets.

2. Flexible routing

Different packets can take different paths through the network.

3. No connection setup delay

A sender can transmit a packet immediately without waiting for connection establishment.

4. Robustness

If one route becomes unavailable, subsequent packets may potentially be routed through another available path.


10. Disadvantages

Because each packet is independent:

  • Packets may arrive out of order.
  • Different packets may experience different delays.
  • Packets may be lost.
  • Packets may follow different paths.
  • The network layer does not maintain a relationship between packets belonging to the same message.

The network layer's responsibility in this approach is essentially to provide packet delivery from source to destination.


Datagram Approach —Summary

The datagram approach is a connectionless packet-switching approach in which every packet is treated as an independent entity. No connection is established before transmission. Each packet contains source and destination addresses and is routed independently based primarily on its destination address. Packets belonging to the same message may follow different paths and may arrive out of order. Routers perform forwarding decisions independently for each packet.

Comments

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Computer Networks

Introduction to Local Area Network (LAN)