{
  "id": "packet-switching",
  "title": "Packet Switching",
  "lang": "en",
  "source_lang": "en",
  "summary": "Packet switching transmits data in discrete units over shared network links, enabling efficient, scalable communication without dedicating a circuit to each exchange.",
  "category": "computer-science",
  "subcategory": "networks-security",
  "type": "concept",
  "aliases": [
    "Packet-switched communication"
  ],
  "generated_at": "2026-11-03",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/packet-switching/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/packet-switching/",
      "json": "https://aiwiki.page/zh/packet-switching.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Packet switching is a method of digital communication in which data is carried as discrete units called packets through a network of interconnected switches or routers. Each packet contains control information, usually in a header, together with a payload. Network equipment uses that information to select an outgoing link, distinguish traffic, and apply forwarding rules. Link capacity is normally shared among many communications rather than permanently assigned to a single conversation.\n\nPacket switching provides the basic communication model of the Internet and most modern local-area, enterprise, and mobile data networks. Its principal advantage is that users with intermittent traffic can share infrastructure efficiently: when one source has nothing to send, others can use the available capacity. The corresponding difficulty is that competing packets may encounter queues, variable delay, or loss. Packet switching therefore encompasses not only the division and forwarding of data but also mechanisms for addressing, routing, buffering, congestion management, and differentiated service.\n\nThe term describes a family of designs, not a single protocol. A packet network may forward each packet independently or establish a logical path before data transfer; it may provide little more than best-effort delivery or support explicit traffic guarantees. These alternatives developed through several independent research traditions during the 1960s and subsequently became central to digital telecommunications."
    },
    {
      "heading": "Operating principles and resource sharing",
      "text": "The defining contrast is with circuit switching, in which communication receives a dedicated allocation of transmission resources for the duration of a connection. In a traditional digital telephone system, for example, a call may receive a recurring time slot on each link along its route. That allocation remains associated with the call even during silence unless additional mechanisms reclaim it. A packet network instead allocates transmission opportunities as packets arrive. Individual links are shared in time, but the sequence of users need not follow a fixed repeating schedule.\n\nThis dynamic sharing is called statistical multiplexing. It works especially well when sources produce bursts rather than continuous streams. A user reading a web page may generate a brief request, receive a burst of data, and then remain idle for seconds. Many such users can share a link because their maximum demands do not usually occur simultaneously. This is a statistical benefit rather than a guarantee: correlated activity, such as many clients requesting an update together, can exhaust the apparent spare capacity.\n\nA simple example illustrates the distinction. A link of 1 gigabit per second can transmit the contents of a 1,000-byte packet in 8 microseconds, excluding link-layer overhead. During the next transmission interval, it can carry a packet from an entirely different communication. If ten senders are idle and an eleventh is active, the active sender may use most of the link. Under a rigid division into eleven equal channels, that sender could not automatically borrow the unused allocations.\n\nPacket forwarding is commonly described as store-and-forward operation. A node receives a packet, checks the information needed for forwarding, and sends it toward the next node. Some equipment can begin transmission before the complete packet has arrived, but packet boundaries and forwarding decisions remain central. A long message divided into packets can also be pipelined: while its first packet traverses a later link, subsequent packets occupy earlier links.\n\nPacket switching does not mean that all resources are unreserved or that all packets are treated identically. Networks can reserve capacity, isolate users, or schedule traffic according to contracts. Nor does it imply a particular physical medium: packet links may use copper, optical fiber, radio, or satellite transmission. The essential property is that data travels as identifiable units whose use of forwarding and transmission resources is managed at packet granularity rather than exclusively through a continuously dedicated end-to-end circuit."
    },
    {
      "heading": "Historical development",
      "text": "Packet switching emerged from several related but distinct investigations into computer communication. Early computers were expensive resources, and remote access often depended on telephone networks designed for sustained voice conversations. Interactive computing and time-sharing produced intermittent traffic that fitted this model poorly. Researchers also sought network structures that could continue operating despite failed links or switching sites.\n\nAt the RAND Corporation, Paul Baran developed proposals for distributed communication networks in the early 1960s. His work, presented in the On Distributed Communications series in 1964, described breaking communications into “message blocks” and forwarding them through a network with multiple possible paths. Survivability was a central concern. The work did not itself produce the later Internet, but it established important ideas about distributed forwarding, redundancy, and communication without dependence on a single central switching point.\n\nAt the United Kingdom’s National Physical Laboratory, Donald Davies independently developed a packet-based approach in the mid-1960s and introduced the term “packet.” Davies emphasized efficient communication among computers, including interactive traffic. The NPL network subsequently provided a working setting for these ideas. Leonard Kleinrock’s early research on communication networks and queueing supplied mathematical tools for analyzing shared links and delay; his 1964 book Communication Nets became an important contribution to the theoretical background.\n\nThe ARPANET, funded by the United States Advanced Research Projects Agency, made packet switching operational across geographically separated research institutions. Its first nodes were connected in 1969. Dedicated computers called Interface Message Processors handled the packet subnet, while host computers attached through defined interfaces. Lawrence Roberts directed the networking program, and a team at Bolt Beranek and Newman built the initial switching equipment. ARPANET experience exposed practical problems in routing, flow control, host interfaces, and congestion.\n\nOther projects explored different divisions of responsibility. Louis Pouzin’s CYCLADES network in France, developed during the 1970s, emphasized datagrams and host responsibility for reliable communication. Commercial public data networks adopted virtual-circuit services, notably through X.25. Vinton Cerf and Robert Kahn’s 1974 paper on packet-network intercommunication addressed how unlike networks could cooperate; the resulting protocol architecture evolved into TCP/IP. ARPANET’s transition to TCP/IP on 1 January 1983 was a major deployment milestone. This history is therefore not a single invention followed by straightforward adoption, but a convergence of survivable networking, resource sharing, distributed protocols, and telecommunications engineering."
    },
    {
      "heading": "Packet structure, layering, and encapsulation",
      "text": "A packet usually consists of a header and a payload, sometimes followed by a trailer. The header may contain source and destination identifiers, a protocol type, a length, sequencing information, and fields controlling forwarding behavior. The payload contains the information being carried at that layer. It may be application data, but it may equally be another packet. A trailer commonly contains an integrity-checking value or other link-specific information.\n\nThis nested organization is called encapsulation. A web response can be carried in a transport-layer unit, enclosed in an Internet Protocol packet, and then enclosed in an Ethernet frame for transmission across one local link. At a router, the incoming link-layer enclosure is ordinarily removed, the network-layer packet is processed, and a new enclosure is constructed for the next link. The packet’s network-layer destination may remain unchanged while the link-layer addresses change at every hop. Tunnels add further layers, allowing one network to carry another network’s packets as payload.\n\nPacket sizes are constrained by the maximum transmission unit (MTU) of a link or path. Conventional Ethernet commonly carries an IP packet of up to 1,500 bytes, although other sizes are used. An IPv4 header is at least 20 bytes, and a TCP header without options is another 20 bytes. Consequently, on a path with a 1,500-byte IP MTU, a common TCP payload size is 1,460 bytes before accounting for additional options or encapsulation.\n\nMTU differences require coordination. IPv4 permits routers to fragment packets when fragmentation is allowed, although avoiding such fragmentation is generally desirable. IPv6 routers do not fragment packets in transit; an originating host may use the IPv6 Fragment extension header. Path MTU discovery and related transport mechanisms seek a size that can traverse the route without relying on intermediate fragmentation. Encapsulation can reduce the usable inner-packet size because the outer headers also consume link capacity.\n\nPacket length creates engineering trade-offs. Large packets amortize header overhead and reduce the number of forwarding operations needed for a given volume of data. Small packets reduce the time that other traffic must wait behind a single transmission and can limit the amount of data lost when one packet is damaged. Fixed-size units simplify some hardware and scheduling designs, while variable-size packets better accommodate diverse payloads. These choices affect efficiency, latency, memory management, and the rate at which a device must process packets."
    },
    {
      "heading": "Datagrams, virtual circuits, and switching alternatives",
      "text": "A datagram network treats packets as independently forwardable units. Each packet carries enough addressing information for the network to select its next hop without first establishing a dedicated end-to-end connection. Internet Protocol follows this model. Routers may maintain extensive routing and policy state, but ordinary IP forwarding does not require a per-connection setup exchange for every pair of communicating applications.\n\nIndependent forwarding does not mean that every successive packet necessarily follows a different path. Routing tables often remain stable, and equipment commonly maps packets belonging to the same flow onto the same path to limit reordering. Nevertheless, a route change, failure, or balancing decision may cause packets to take different paths. A datagram service generally does not promise delivery, uniqueness, order, or a fixed transit time. Those properties, where needed, must be provided through additional mechanisms.\n\nA virtual circuit establishes a logical forwarding relationship before or as traffic begins. Switching nodes associate a short local identifier with an outgoing link and another identifier. Packets then follow the established relationship rather than undergoing a full destination-address lookup at each hop. A virtual circuit shares physical links with other traffic, so it is not necessarily a dedicated physical circuit. Its state can, however, support admission control, accounting, ordering, and resource allocation.\n\nX.25, first standardized by the international telegraph and telephone consultative body in 1976, defined a widely used interface for public packet networks with virtual-call and permanent-virtual-circuit services. Asynchronous Transfer Mode used fixed-size 53-byte cells, comprising a 5-byte header and 48 bytes of payload, to integrate different traffic types. Its virtual-path and virtual-channel identifiers supported efficient switching and detailed traffic management, although small cells also imposed substantial overhead on large data transfers.\n\nMultiprotocol Label Switching (MPLS) applies short labels to select forwarding treatment through a network. Label-switched paths support traffic engineering, service separation, and provider virtual private networks. MPLS is frequently connection-oriented in its forwarding organization, but it does not automatically guarantee bandwidth or reliability. These examples show why “connectionless” and “packet-switched” are not synonyms. They also distinguish packet switching from message switching, in which an entire message is the forwarding unit: packetization permits finer sharing and pipelining, while virtual circuits determine how those packets are associated with paths and state."
    },
    {
      "heading": "Routing, forwarding, and network resilience",
      "text": "Routing determines which paths are available and preferred; forwarding applies the resulting rules to individual packets. The distinction separates a control problem from a high-speed processing task. A router’s control plane exchanges reachability information, computes or selects routes, and installs forwarding entries. Its data plane examines arriving packets and applies those entries, often using specialized hardware rather than executing the routing protocol for every packet.\n\nIn IP networks, forwarding commonly uses longest-prefix matching. A destination address is compared with address prefixes, and the most specific matching prefix selects a next hop or other action. A route for a narrower address range takes precedence over a broader route even if both match. The next hop need not be the final destination: packet delivery proceeds through a sequence of local forwarding decisions. The routing system must make those decisions collectively useful without requiring each packet to carry a complete description of the network.\n\nWithin an administrative domain, protocols such as Open Shortest Path First distribute information about topology and link costs. Routers can then use Dijkstra’s algorithm to calculate shortest paths according to those costs. Between independently administered networks, the Border Gateway Protocol (BGP) exchanges reachability together with path attributes. BGP route selection reflects policy as well as topology, including commercial relationships and administrative preferences. The selected route therefore need not minimize geographic distance, delay, or hop count.\n\nResilience depends on both physical alternatives and timely control behavior. If a link fails, the network may detect the failure and select another route. During the transition, packets can be dropped, loop temporarily, or arrive out of order because different routers update at different times. Fast-reroute mechanisms can install or prepare local alternatives before the broader routing system converges. These mechanisms improve recovery, but packet switching by itself does not guarantee that a surviving path exists or that recovery is instantaneous.\n\nLoad distribution introduces another set of choices. Equal-cost multipath forwarding can spread flows across several routes with equivalent routing cost. A hash over selected packet fields commonly keeps a flow on one path, reducing reordering while distributing many flows statistically. Uneven flow sizes can still create hotspots. More adaptive methods respond to congestion or divide traffic into smaller units, but require care to avoid instability and excessive reordering. Routing thus establishes possible paths, while traffic distribution and scheduling determine how effectively those paths are used."
    },
    {
      "heading": "Delay, queues, and capacity",
      "text": "A packet’s transit time includes processing, queueing, transmission, and propagation delays. Processing covers tasks such as parsing a header and selecting an output. Queueing occurs while the packet waits for a transmission opportunity. Transmission delay is the time required to place the packet’s bits onto a link, while propagation delay is the time required for the signal to travel through the medium. Increasing link rate reduces transmission delay but does not proportionally reduce propagation time.\n\nFor a packet of length \\(L\\) bits on a link of rate \\(R\\) bits per second,\n\n\\[d_{\\mathrm{transmission}}=\\frac{L}{R}.\\]\n\nA 1,500-byte packet therefore takes 12 microseconds to serialize at 1 gigabit per second, ignoring additional link overhead. By comparison, propagation through 1,000 kilometres of optical fiber is approximately 5 milliseconds one way, depending on the actual path and medium. Faster switching cannot eliminate this distance-dependent component.\n\nPacketization also enables pipelining. Suppose a message is divided into \\(P\\) equal packets, each \\(L\\) bits long, and crosses \\(H\\) equal-rate store-and-forward links. Ignoring headers, processing, propagation, and competing traffic, completion takes\n\n\\[T=(P+H-1)\\frac{L}{R}.\\]\n\nThe first packet must cross all \\(H\\) links, but subsequent packets can advance simultaneously on different links. Forwarding the whole message as one indivisible unit would instead require each link to receive the complete message before the next transmission begins.\n\nQueueing theory explains why low average utilization does not necessarily mean negligible delay. For an idealized M/M/1 queue with Poisson arrivals at rate \\(\\lambda\\), exponentially distributed service times with rate \\(\\mu\\), an unlimited buffer, and \\(\\lambda<\\mu\\), mean waiting time before service is\n\n\\[W_q=\\frac{\\lambda}{\\mu(\\mu-\\lambda)}.\\]\n\nThe sharp increase as arrival rate approaches service rate captures an important phenomenon, although real packet traffic and service times often violate these assumptions. Bursts, correlated flows, and variable packet lengths can produce very different delay distributions.\n\nReal buffers are finite, so overload eventually causes packet drops rather than unlimited queue growth. Little’s law, \\(N=\\lambda W\\), relates average population, throughput, and residence time in a stable system under appropriate conditions. It helps connect buffered traffic volume with experienced delay. Large buffers absorb bursts but can also sustain long queues, a condition known as bufferbloat. Small buffers reduce queueing capacity but may drop bursts that the link could otherwise absorb. Buffer design therefore depends on workload, congestion-control behavior, scheduling, and the acceptable balance between loss and latency."
    },
    {
      "heading": "Reliability, flow control, and congestion control",
      "text": "Packet switching does not inherently ensure reliable delivery. A packet may disappear because a buffer fills, a link corrupts data, a device fails, or a forwarding rule discards it. Reliability is assembled from mechanisms at different layers. A link may detect damage and retransmit locally; a transport protocol may detect missing data across the complete path. Local recovery can hide transient errors efficiently, but it does not establish that the destination application received the information.\n\nTransmission Control Protocol (TCP) supplies an ordered byte stream over IP. Sequence numbers identify positions in that stream, acknowledgments report reception, and retransmission repairs losses. Timers and acknowledgment patterns help infer when data is missing. The receiver uses sequence information to discard duplicates and place reordered data correctly. TCP does not preserve application message boundaries, so an application must define how its messages are delimited within the stream.\n\nFlow control and congestion control solve different problems. Flow control prevents a sender from overwhelming the receiving endpoint’s available buffer space. Congestion control limits traffic entering a network whose links or queues are overloaded. TCP’s receiver-advertised window and congestion window impose separate constraints; the amount of unacknowledged data is normally limited by both. A receiver with abundant memory cannot eliminate a bottleneck in the middle of the path.\n\nCongestion collapse demonstrated why this distinction matters. During the 1980s, heavily loaded Internet paths could spend substantial capacity carrying retransmissions or packets that would later be discarded. Van Jacobson’s work, published in 1988, established influential TCP mechanisms including slow start, congestion avoidance, and improved retransmission timing. Classic congestion avoidance increases the sending window cautiously and reduces it after congestion signals. Later algorithms use different models and measurements, but retain the requirement to respond to limited shared capacity.\n\nNetworks can signal congestion through packet loss or Explicit Congestion Notification, which permits capable equipment to mark packets rather than discard them solely to convey congestion. Active queue management deliberately marks or drops packets before a buffer is completely full, seeking to control persistent queue growth. The result depends on endpoint response: marking cannot regulate a source that ignores it. Newer transports such as QUIC also provide loss recovery and congestion control, while allowing multiple streams within one connection without TCP’s cross-stream ordering constraint. Reliable delivery, congestion response, and application-level confirmation remain distinct properties even when one protocol implements several of them."
    },
    {
      "heading": "Switching hardware and programmable networks",
      "text": "A packet-switching device typically contains input and output interfaces, packet buffers, a forwarding engine, and an internal switching fabric. On arrival, a packet is parsed to identify relevant fields. The device performs lookups, applies filtering or rewriting rules, selects an output and queue, and schedules transmission. Some operations occur at ingress, others at egress, and the division depends on the architecture. High-performance equipment must perform these steps for many packets concurrently.\n\nBandwidth alone does not describe forwarding difficulty. Small packets require more decisions per second than large packets at the same bit rate. On conventional Ethernet, a minimum-size frame occupies 64 bytes, with additional time for an 8-byte preamble and start delimiter and a 12-byte inter-frame gap. At 100 gigabits per second, that corresponds to approximately 148.8 million minimum-size frames per second. A device can therefore meet a throughput target with large packets yet fail to sustain full rate with small ones.\n\nSpecialized application-specific integrated circuits provide parallel lookup, queue management, and packet modification at high speed. Forwarding tables may use combinations of static memory, ternary content-addressable memory, and algorithmic data structures. Memory capacity, lookup width, power consumption, and update rate constrain the number and complexity of rules. Packet-buffer memory presents a separate challenge because it must support high aggregate read and write bandwidth as traffic enters and leaves queues.\n\nThe switching fabric must connect inputs to outputs without becoming the bottleneck. A simple input queue can suffer head-of-line blocking: its first packet waits for a busy output and prevents following packets from reaching idle outputs. Virtual output queues separate packets according to their intended outputs, allowing a scheduler to choose nonconflicting transfers. Shared-memory and crossbar designs make different trade-offs in buffering efficiency, arbitration complexity, and scalability. Even a nonblocking internal fabric cannot prevent congestion when several inputs collectively offer more traffic than one output can transmit.\n\nSoftware-defined networking makes forwarding behavior explicitly controllable through software interfaces and separates aspects of control logic from individual devices. Programmable packet-processing pipelines permit new header formats and actions within hardware limits. Software switches running on general-purpose processors provide flexibility for virtualization and cloud computing, but must manage CPU, memory, and input-output overhead. These approaches do not remove the physical constraints of packet switching; they change where policies are expressed and how forwarding functions are deployed."
    },
    {
      "heading": "Service quality and modern applications",
      "text": "Packet switching accommodates diverse applications because the same infrastructure can carry traffic with very different requirements. File transfer usually prioritizes complete, correct delivery and can tolerate variable arrival times. Interactive voice and video are more sensitive to delay and delay variation, while occasional late or lost data may be preferable to waiting for retransmission. Industrial control and some financial applications may demand tighter bounds on latency. Large-scale computing can generate bursts between many servers, creating congestion even when average network utilization appears moderate.\n\nQuality of service (QoS) mechanisms classify traffic and allocate forwarding treatment. A scheduler may use strict priority, weighted service, or per-flow fairness. Strict priority can reduce delay for one class but starve lower-priority traffic if the preferred class is not constrained. Weighted scheduling divides capacity according to configured shares while often allowing unused capacity to be borrowed. Classification labels alone provide no guarantee: their effect depends on the behavior and provisioning of every relevant bottleneck.\n\nTraffic shaping delays packets to fit a specified transmission pattern, whereas policing identifies traffic exceeding a contract and may drop or remark it. A token-bucket model characterizes a sustained rate together with a permitted burst. Admission control goes further by rejecting or deferring new traffic when the network cannot support its requested service. These mechanisms make packet networks capable of carrying controlled, predictable services, but strong end-to-end guarantees require coordinated resource management across the path.\n\nMobile networks illustrate the distinction between a packet service and the radio resources that carry it. Fourth-generation LTE networks use a packet-based core, while voice can be provided through services such as Voice over LTE. Fifth-generation systems likewise carry user data as packets while applying sophisticated radio scheduling, bearer or flow management, and service differentiation. Underlying radio transmissions still need timing, coding, and resource allocation; packet switching does not imply that the physical channel is accessed without coordination.\n\nIn data centers, distributed applications may exchange many small messages or transfer large datasets across parallel paths. An incast event occurs when many senders simultaneously transmit toward one receiver, overwhelming its incoming link or the nearby switch buffer. Such workloads motivate careful congestion signaling, queue management, and endpoint coordination. Packet switching’s ability to mix workloads remains valuable, but efficient operation depends on matching application behavior, transport protocols, and network provisioning rather than assuming that shared capacity will always be available when needed."
    },
    {
      "heading": "Security, operational visibility, and architectural limits",
      "text": "A shared packet infrastructure must distinguish legitimate traffic from malformed, unauthorized, or excessive traffic. Header fields make selective forwarding possible, but also create opportunities for spoofing and manipulation. A source address is not, by itself, proof of identity. Networks use filtering, address-validation policies, segmentation, and authentication mechanisms at appropriate layers to constrain who may send traffic and which destinations or services may be reached.\n\nA denial-of-service attack can exploit the fact that link capacity, packet-processing time, queue space, and connection state are finite. Volumetric traffic may saturate an access link before packets reach the intended server. Other attacks use relatively little bandwidth but force expensive processing or exhaust state tables. Countermeasures consequently operate at different locations, from local filtering to upstream traffic scrubbing and distributed mitigation. Adding server capacity alone cannot recover bandwidth already exhausted on an upstream link.\n\nEncryption protects packet contents within a defined security association, but it does not necessarily conceal all observable information. Packet sizes, timing, outer addresses, and communication patterns may remain visible. Transport Layer Security protects application exchanges while normally leaving IP routing information exposed. Encrypted tunnels can conceal inner headers, yet the tunnel endpoints and outer traffic characteristics remain available to observers. Integrity and confidentiality mechanisms also do not prevent congestion or guarantee delivery.\n\nOperational diagnosis relies on counters, sampled traffic records, queue measurements, and active probes. Packet captures can reveal retransmissions, timing, and protocol behavior, subject to visibility and privacy constraints. Ping measures responses to probe packets rather than every property of an application path. Traceroute uses limited packet lifetimes to elicit information about intermediate routers, but filtering, load balancing, and asymmetric routing complicate interpretation. A responding router is evidence about a particular probe, not proof that all traffic follows the same route or receives the same treatment.\n\nThe Internet’s best-effort model also places limits on what applications may infer. Successful local transmission does not establish remote receipt, and a transport acknowledgment does not necessarily establish that an application has durably recorded a transaction. Distributed computing protocols must handle failures, retries, duplicate requests, and uncertain outcomes above the packet layer. Middleboxes, tunnels, and policy boundaries further affect which protocols can traverse a path. Protocol design therefore has to account both for the abstract packet service and for the concrete forwarding, security, and administrative conditions encountered in deployed networks."
    }
  ],
  "links": [
    "network-packet",
    "router",
    "internet",
    "circuit-switching",
    "time-sharing",
    "arpanet",
    "tcp-ip",
    "ospf",
    "dijkstra-algorithm",
    "application-specific-integrated-circuit",
    "virtualization",
    "cloud-computing",
    "data-center",
    "authentication",
    "denial-of-service-attack",
    "encryption",
    "transport-layer-security",
    "distributed-computing"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}