Techniques

Packet switching

A method of breaking data into packets for independent routing, used for example on the Internet.

What is packet switching?

Packet switching divides a data stream or larger message into smaller units called packets. Each packet is forwarded as a separate unit, allowing multiple sources to share links for the short transmission time of individual packets.

A packet carries data and control information needed by the relevant protocol layer. Dividing a larger message preserves addressing, lets the network interleave traffic from multiple sources, and can leave reordering of received pieces to the appropriate protocol. The properties of this model are:

  • Addressing: A network-layer packet can carry source and destination addresses, such as IP addresses.
  • Independent routing: In a datagram service, a router makes a decision for each packet. Route changes can send packets from one message along different paths.
  • Reassembly: A higher-layer protocol can use sequence numbers to restore data order. IP itself does not provide ordering or retransmission for lost datagrams.

Packet switching and circuit switching

Packet switching shares resources for the duration of packet transmission. In , used in traditional telephone networks, a call reserves a path or resources for the session, including silent periods. Packet switching uses statistical sharing, so the same infrastructure can carry packets from different sessions.

Packet structure

Packet format depends on the protocol. A simplified description has a header with control information and a data field, while additional headers and trailers can belong to other layers.

  • Header: Control information at the start of a unit describes how the relevant protocol handles it. An IP header includes, among other fields:
    • Source and destination addresses: They identify the datagram's sender and recipient, for example through IP addresses.
    • Sequence number: Transport protocols such as TCP use one to help the receiver reorder segments. It is not present in every IP header.
    • Error-checking information: IPv4 has a header checksum, while CRC checking usually belongs to the data-link layer. The protection scope depends on the protocol.
    • Other control data, such as length, time to live, protocol type, or priority.
  • Payload: This is the data carried by the packet, often a transport-layer segment. Its size depends on the protocol, headers, and the maximum transmission unit of the link.

Forwarding a packet with store-and-forward

In the store-and-forward model, a router receives a complete packet on an input port and stores it in a buffer before transmission. It selects the next hop from the destination address and routing table. Specific devices can use other forwarding mechanisms, but the sequence below describes processing of a complete packet.

  1. Store: A router receives a complete packet on an input port and temporarily stores it in a memory buffer.
  2. Process: The router reads the packet header, determines the destination, and consults its routing table or forwarding database to select the next hop.
  3. Forward: The router places the packet in the queue for the appropriate output port and sends it to the next hop.

The process repeats at subsequent routers until the packet reaches its destination network or host.

Datagrams and virtual circuits

Packet-switched services are often described using two service models:

Connectionless (Datagram)

In this mode, each packet, called a datagram, is an independent entity. A router makes a decision for each packet using its address and current route information. Route changes can send packets from one message along different paths, and a datagram can arrive out of order or be lost. IP provides neither ordering nor retransmission; a higher-layer protocol such as TCP can provide those functions.

Example: The Internet Protocol (IP).

Connection-Oriented (Virtual Circuit)

In this mode, a logical path called a is established between the sender and receiver before data transfer. Packets in the session use the established path and a circuit identifier, so intermediary nodes need not perform a full route selection for every packet. The path alone does not guarantee delivery or order after loss; those properties depend on the service, such as X.25.

Example: ATM (Asynchronous Transfer Mode).

Advantages and disadvantages of packet switching

Advantages

  • Shared resources: Many users can use the same links, and a channel is occupied for the packet transmission time. Statistical multiplexing uses the gaps between bursts of data.
  • Failure response: After a topology change, routing protocols can select alternate paths. Some packets can be delayed or lost while the network converges.
  • Flexibility: One infrastructure can support services with different bit rates without reserving a fixed rate for every session.

Disadvantages

  • Variable latency: Router queues add delay that depends on traffic. Packet delay variation, often called jitter, complicates voice and videoconference traffic.
  • Header overhead: Every packet carries control information, so small payloads devote a larger share of the link rate to headers.
  • Processing requirements: End systems can need sequence numbers, reordering, and retransmission of lost units, as provided by TCP over IP.

Related articles