Packet
Encyclopedia
In computer networking, a packet is a formatted unit of data
Data
The term data refers to qualitative or quantitative attributes of a variable or set of variables. Data are typically the results of measurements and can be the basis of graphs, images, or observations of a set of variables. Data are often viewed as the lowest level of abstraction from which...

 carried by a packet mode computer network
Computer network
A computer network, often simply referred to as a network, is a collection of hardware components and computers interconnected by communication channels that allow sharing of resources and information....

. Computer communications links that do not support packets, such as traditional point-to-point telecommunications links, simply transmit data as a series of bytes, characters
Character (computing)
In computer and machine-based telecommunications terminology, a character is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabary in the written form of a natural language....

, or bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

s alone. When data is formatted into packets, the bitrate
Bitrate
In telecommunications and computing, bit rate is the number of bits that are conveyed or processed per unit of time....

 of the communication medium can be better shared among users than if the network were circuit switched
Circuit switching
Circuit switching is a methodology of implementing a telecommunications network in which two network nodes establish a dedicated communications channel through the network before the nodes may communicate. The circuit guarantees the full bandwidth of the channel and remains connected for the...

. By using packet switched
Packet switching
Packet switching is a digital networking communications method that groups all transmitted data – regardless of content, type, or structure – into suitably sized blocks, called packets. Packet switching features delivery of variable-bit-rate data streams over a shared network...

 networking it is also harder to guarantee a lowest possible bitrate.

Packet framing

A packet consists of two kinds of data: control information and user data (also known as payload). The control information provides data the network needs to deliver the user data, for example: source and destination addresses, error detection codes like checksums, and sequencing information. Typically, control information is found in packet headers and trailers, with user data in between.

Different communications protocol
Communications protocol
A communications protocol is a system of digital message formats and rules for exchanging those messages in or between computing systems and in telecommunications...

s use different conventions for distinguishing between the elements and for formatting the data. In Binary Synchronous Transmission, the packet is formatted in 8-bit bytes, and special characters are used to delimit the different elements. Other protocols, like Ethernet
Ethernet
Ethernet is a family of computer networking technologies for local area networks commercially introduced in 1980. Standardized in IEEE 802.3, Ethernet has largely replaced competing wired LAN technologies....

, establish the start of the header and data elements by their location relative to the start of the packet. Some protocols format the information at a bit level instead of a byte level.

A good analogy is to consider a packet to be like a letter: the header is like the envelope, and the data area is whatever the person puts inside the envelope. A difference, however, is that some networks can break a larger packet into smaller packets when necessary (note that these smaller data elements are still formatted as packets).

A network design can achieve two major results by using packets: error detection and multiple host addressing.

Error detection

It is more efficient and reliable to calculate a checksum
Checksum
A checksum or hash sum is a fixed-size datum computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmission or storage. The integrity of the data can be checked at any later time by recomputing the checksum and...

 or cyclic redundancy check
Cyclic redundancy check
A cyclic redundancy check is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data...

 over the contents of a packet than to check errors using character-by-character parity bit
Parity bit
A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is even or odd. Parity bits are used as the simplest form of error detecting code....

 checking.

The packet trailer often contains error checking data to detect errors that occur during transmission.

Host addressing

Modern networks usually connect three or more host computers together; in such cases the packet header generally contains addressing information so that the packet is received by the correct host computer. In complex networks constructed of multiple routing and switching nodes, like the ARPANET
ARPANET
The Advanced Research Projects Agency Network , was the world's first operational packet switching network and the core network of a set that came to compose the global Internet...

 and the modern Internet
Internet
The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite to serve billions of users worldwide...

, a series of packets sent from one host computer to another may follow different routes to reach the same destination. This technology is called packet switching
Packet switching
Packet switching is a digital networking communications method that groups all transmitted data – regardless of content, type, or structure – into suitably sized blocks, called packets. Packet switching features delivery of variable-bit-rate data streams over a shared network...

.

Terminology

In the seven-layer OSI model
OSI model
The Open Systems Interconnection model is a product of the Open Systems Interconnection effort at the International Organization for Standardization. It is a prescription of characterizing and standardizing the functions of a communications system in terms of abstraction layers. Similar...

 of computer networking, 'packet' strictly refers to a data unit
Protocol data unit
In telecommunications, the term protocol data unit has the following meanings:#Information that is delivered as a unit among peer entities of a network and that may contain control information, address information, or data....

 at layer 3, the Network Layer
Network Layer
The network layer is layer 3 of the seven-layer OSI model of computer networking.The network layer is responsible for packet forwarding including routing through intermediate routers, whereas the data link layer is responsible for media access control, flow control and error checking.The network...

. The correct term for a data unit at the Data Link Layer
Data link layer
The data link layer is layer 2 of the seven-layer OSI model of computer networking. It corresponds to, or is part of the link layer of the TCP/IP reference model....

—Layer 2 of the seven-layer OSI model
OSI model
The Open Systems Interconnection model is a product of the Open Systems Interconnection effort at the International Organization for Standardization. It is a prescription of characterizing and standardizing the functions of a communications system in terms of abstraction layers. Similar...

—is a frame, and at Layer 4, the Transport Layer
Transport layer
In computer networking, the transport layer or layer 4 provides end-to-end communication services for applications within a layered architecture of network components and protocols...

, the correct term is a segment or datagram. Hence, e.g, a TCP segment is carried in one or more IP
Internet Protocol
The Internet Protocol is the principal communications protocol used for relaying datagrams across an internetwork using the Internet Protocol Suite...

 Layer packets, which are each carried in one or more Ethernet
Ethernet
Ethernet is a family of computer networking technologies for local area networks commercially introduced in 1980. Standardized in IEEE 802.3, Ethernet has largely replaced competing wired LAN technologies....

 frames—though the mapping of TCP, IP, and Ethernet, to the layers of the OSI model is not exact.

In general, the term packet applies to any message formatted as a packet, while the term datagram is reserved for packets of an "unreliable" service. A "reliable" service is one that notifies the user if delivery fails, while an "unreliable" one does not notify the user if delivery fails. For example, IP
Internet Protocol
The Internet Protocol is the principal communications protocol used for relaying datagrams across an internetwork using the Internet Protocol Suite...

 provides an unreliable service. Together, TCP
Transmission Control Protocol
The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol , and therefore the entire suite is commonly referred to as TCP/IP...

 and IP
Internet Protocol
The Internet Protocol is the principal communications protocol used for relaying datagrams across an internetwork using the Internet Protocol Suite...

 provide a reliable service, whereas UDP
User Datagram Protocol
The User Datagram Protocol is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol network without requiring...

 and IP
Internet Protocol
The Internet Protocol is the principal communications protocol used for relaying datagrams across an internetwork using the Internet Protocol Suite...

 provide an unreliable one. All these protocols use packets, but UDP
User Datagram Protocol
The User Datagram Protocol is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol network without requiring...

 packets are generally called datagrams.

When the ARPANET
ARPANET
The Advanced Research Projects Agency Network , was the world's first operational packet switching network and the core network of a set that came to compose the global Internet...

 pioneered packet switching, it provided a reliable packet delivery procedure to its connected hosts via its 1822 interface
BBN Report 1822
BBN Report 1822 specifies the method for connecting a host computer to an ARPANET router, called an Interface Message Processor . This connection and protocol is generally referred to as 1822, the report number....

. A host computer simply arranged the data in the correct packet format, inserted the address of the destination host computer, and sent the message across the interface to its connected Interface Message Processor
Interface Message Processor
The Interface Message Processor was the packet-switching node used to interconnect participant networks to the ARPANET from the late 1960s to 1989. It was the first generation of gateways, which are known today as routers. An IMP was a ruggedized Honeywell DDP-516 minicomputer with...

. Once the message was delivered to the destination host, an acknowledgement was delivered to the sending host. If the network could not deliver the message, it would send an error message back to the sending host.

Meanwhile, the developers of CYCLADES
CYCLADES
The CYCLADES packet switching network was a French research network created in the early 1970s. It was developed to explore alternatives to the ARPANET design and to support network research generally...

 and of ALOHAnet
ALOHAnet
ALOHAnet, also known as the ALOHA System, or simply ALOHA, was a pioneering computer networking system developed at the University of Hawaii. ALOHAnet became operational in June, 1971, providing the first public demonstration of a wireless packet data network.The ALOHAnet used a new method of...

 demonstrated that it was possible to build an effective computer network without providing reliable packet transmission. This lesson was later embraced by the designers of Ethernet
Ethernet
Ethernet is a family of computer networking technologies for local area networks commercially introduced in 1980. Standardized in IEEE 802.3, Ethernet has largely replaced competing wired LAN technologies....

.

If a network does not guarantee packet delivery, then it becomes the host's responsibility to provide reliability by detecting and retransmitting lost packets. Subsequent experience on the ARPANET indicated that the network itself could not reliably detect all packet delivery failures, and this pushed responsibility for error detection onto the sending host in any case. This led to the development of the end-to-end principle
End-to-end principle
The end-to-end principle is a classic design principle of computer networking which states that application specific functions ought to reside in the end hosts of a network rather than in intermediary nodes, provided they can be implemented "completely and correctly" in the end hosts...

, which is one of the Internet
Internet
The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite to serve billions of users worldwide...

's fundamental design assumptions.

Example: IP packets

IP
Internet Protocol
The Internet Protocol is the principal communications protocol used for relaying datagrams across an internetwork using the Internet Protocol Suite...

 packets are composed of a header and payload. The IPv4 packet header consists of:
  1. 4 bits that contain the version, that specifies if it's an IPv4
    IPv4
    Internet Protocol version 4 is the fourth revision in the development of the Internet Protocol and the first version of the protocol to be widely deployed. Together with IPv6, it is at the core of standards-based internetworking methods of the Internet...

     or IPv6
    IPv6
    Internet Protocol version 6 is a version of the Internet Protocol . It is designed to succeed the Internet Protocol version 4...

     packet,
  2. 4 bits that contain the Internet Header Length, which is the length of the header in multiples of 4 bytes (e.g., 5 means 20 bytes).
  3. 8 bits that contain the Type of Service, also referred to as Quality of Service
    Quality of service
    The quality of service refers to several related aspects of telephony and computer networks that allow the transport of traffic with special requirements...

     (QoS), which describes what priority the packet should have,
  4. 16 bits that contain the length of the packet in bytes,
  5. 16 bits that contain an identification tag to help reconstruct the packet from several fragments
    IP fragmentation
    The Internet Protocol implements datagram fragmentation, so that packets may be formed that can pass through a link with a smaller maximum transmission unit than the original datagram size....

    ,
  6. 3 bits that contain a zero, a flag that says whether the packet is allowed to be fragmented or not (DF: Don't fragment), and a flag to state whether more fragments of a packet follow (MF: More Fragments)
  7. 13 bits that contain the fragment offset, a field to identify position of fragment within original packet
  8. 8 bits that contain the Time to live
    Time to live
    Time to live is a mechanism that limits the lifespan of data in a computer or network. TTL may be implemented as a counter or timestamp attached to or embedded in the data. Once the prescribed event count or timespan has elapsed, data is discarded. In computer networking, TTL prevents a data...

    (TTL), which is the number of hops (router, computer or device along a network) the packet is allowed to pass before it dies (for example, a packet with a TTL of 16 will be allowed to go across 16 routers to get to its destination before it is discarded),
  9. 8 bits that contain the protocol (TCP, UDP, ICMP, etc.)
  10. 16 bits that contain the Header Checksum, a number used in error detection,
  11. 32 bits that contain the source IP address,
  12. 32 bits that contain the destination address.


After those 160 bits, optional flags can be added of varied length, which can change based on the protocol used, then the data that packet carries is added. An IP packet has no trailer. However, an IP packet is often carried as the payload inside an Ethernet frame, which has its own header and trailer.

Delivery not guaranteed

Many networks do not provide guarantees of delivery, nonduplication of packets, or in-order delivery of packets, e.g., the UDP
User Datagram Protocol
The User Datagram Protocol is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol network without requiring...

 protocol of the Internet
Internet protocol suite
The Internet protocol suite is the set of communications protocols used for the Internet and other similar networks. It is commonly known as TCP/IP from its most important protocols: Transmission Control Protocol and Internet Protocol , which were the first networking protocols defined in this...

. However, it is possible to layer a transport protocol on top of the packet service that can provide such protection; TCP
Transmission Control Protocol
The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol , and therefore the entire suite is commonly referred to as TCP/IP...

 and UDP
User Datagram Protocol
The User Datagram Protocol is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol network without requiring...

 are the best examples of layer 4, the Transport Layer, of the seven layered OSI model
OSI model
The Open Systems Interconnection model is a product of the Open Systems Interconnection effort at the International Organization for Standardization. It is a prescription of characterizing and standardizing the functions of a communications system in terms of abstraction layers. Similar...

.

The header of a packet specifies the data type, packet number, total number of packets, and the sender's and receiver's IP address
IP address
An Internet Protocol address is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing...

es.

The term frame is sometimes used to refer to a packet exactly as transmitted over the wire or radio.

Example: the NASA Deep Space Network

The Consultative Committee for Space Data Systems (CCSDS) packet telemetry standard defines
the protocol used for the transmission of spacecraft instrument data over the deep-space channel. Under this standard, an image or other data sent from a spacecraft instrument is transmitted using one or more packets.

CCSDS packet definition

A packet is a block of data with length that can vary between successive packets, ranging from 7
to 65,542 bytes, including the packet header.
  • Packetized data is transmitted via frames, which are fixed-length data blocks. The size of a frame, including frame header and control information, can range up to 2048 bytes.
  • Packet sizes are fixed during the development phase.

Because packet lengths are variable but frame lengths are fixed, packet boundaries usually do not coincide with frame boundaries.

Telecom processing notes

Data in a frame is typically protected from channel errors by error-correcting codes.
  • Even when the channel errors exceed the correction capability of the error-correcting code, the presence of errors nearly always is detected by the error-correcting code or by a separate error-detecting code.
  • Frames for which uncorrectable errors are detected are marked as undecodable and typically are deleted.

Handling data loss

Deleted undecodable whole frames are the principal type of data loss that affects compressed data sets. In general, there would be little to gain from attempting to use compressed data from a frame marked as undecodable.
  • When errors are present in a frame, the bits of the subband pixels are already decoded before the first bit error will remain intact, but all subsequent decoded bits in the segment usually will be completely corrupted; a single bit error is often just as disruptive as many bit errors.
  • Furthermore, compressed data usually are protected by powerful, long-blocklength error-correcting codes, which are the types of codes most likely to yield substantial fractions of bit errors throughout those frames that are undecodable.


Thus, frames with detected errors would be essentially unusable even if they were not deleted by the frame processor.

This data loss can be compensated for with the following mechanisms.
  • If an erroneous frame escapes detection, the decompressor will blindly use the frame data as if they were reliable, whereas in the case of detected erroneous frames, the decompressor can base its reconstruction on incomplete, but not misleading, data.
  • However, it is extremely rare for an erroneous frame to go undetected.
  • For frames coded by the CCSDS Reed–Solomon code
    Reed–Solomon error correction
    In coding theory, Reed–Solomon codes are non-binary cyclic error-correcting codes invented by Irving S. Reed and Gustave Solomon. They described a systematic way of building codes that could detect and correct multiple random symbol errors...

    , fewer than 1 in 40,000 erroneous frames can escape detection.
  • All frames not employing the Reed–Solomon code use a cyclic redundancy check
    Cyclic redundancy check
    A cyclic redundancy check is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data...

     (CRC) error-detecting code, which has an undetected frame-error rate of less than 1 in 32,000.

MPEG packetized stream

Packetized Elementary Stream (PES) is a specification defined by the MPEG communication protocol (see the MPEG-2
MPEG-2
MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission...

 standard) that allows an elementary stream
Elementary stream
An elementary stream as defined by MPEG communication protocol is usually the output of an audio or video encoder. ES contains only one kind of data, e.g. audio, video or closed caption. An elementary stream is often referred to as "elementary", "data", "audio", or "video" bitstreams or streams...

 to be divided into packets. The elementary stream is packetized by encapsulating sequential data bytes from the elementary stream inside PES packet headers.

A typical method of transmitting elementary stream data from a video or audio encoder is to first create PES packets from the elementary stream data and then to encapsulate these PES packets inside an MPEG transport stream (TS) packets or an MPEG program stream (PS). The TS packets can then be multiplexed and transmitted using broadcasting techniques, such as those used in an ATSC
ATSC tuner
An ATSC tuner, often called an ATSC receiver or HDTV tuner is a type of television tuner that allows reception of digital television television channels transmitted by television stations in North America, parts of Central America and South Korea that use ATSC standards...

 and DVB.

PES packet header

NameSizeDescription
Packet start code prefix 3 bytes 0x000001
Stream id 1 byte Examples: Audio streams (0xC0-0xDF), Video streams (0xE0-0xEF)
Note: The above 4 bytes is called the 32-bit start code.
PES Packet length 2 bytes Can be zero as in not specified for video streams in MPEG transport streams
Optional PES header variable length
Stuffing bytes variable length
Data See elementary stream
Elementary stream
An elementary stream as defined by MPEG communication protocol is usually the output of an audio or video encoder. ES contains only one kind of data, e.g. audio, video or closed caption. An elementary stream is often referred to as "elementary", "data", "audio", or "video" bitstreams or streams...

. In the case of private streams the first byte of the payload is the sub-stream number.

Optional PES header

NameNumber of BitsDescription
Marker bits 2 10 binary
Binary numeral system
The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...

 or 0x2 hex
Hexadecimal
In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...

Scrambling control 2 00 implies not scrambled
Priority 1
Data alignment indicator 1 1 indicates that the PES packet header is immediately followed by the video start code or audio syncword
Syncword
In computer networks, a syncword, sync character or preamble is used to synchronize a transmission by indicating the end of header information and the start of data.-Examples:For example an audio receiver is receiving a bit stream of data...

Copyright 1 1 implies copyrighted
Original or Copy 1 1 implies original
PTS DTS indicator 2 11 = both present, 10 = only PTS
ESCR flag 1
ES rate flag 1
DSM trick mode flag 1
Additional copy info flag 1
CRC flag 1
extension flag 1
PES header length 8 gives the length of the remainder of the PES header
Optional fields variable length presence is determined by flag bits above
Stuffing Bytes variable length 0xff

NICAM

In order to provide mono
Monaural
Monaural or monophonic sound reproduction is single-channel. Typically there is only one microphone, one loudspeaker, or channels are fed from a common signal path...

 "compatibility", the NICAM signal is transmitted on a subcarrier
Subcarrier
A subcarrier is a separate analog or digital signal carried on a main radio transmission, which carries extra information such as voice or data. More technically, it is an already-modulated signal, which is then modulated into another signal of higher frequency and bandwidth...

 alongside the sound carrier. This means that the FM
Frequency modulation
In telecommunications and signal processing, frequency modulation conveys information over a carrier wave by varying its instantaneous frequency. This contrasts with amplitude modulation, in which the amplitude of the carrier is varied while its frequency remains constant...

 or AM
Amplitude modulation
Amplitude modulation is a technique used in electronic communication, most commonly for transmitting information via a radio carrier wave. AM works by varying the strength of the transmitted signal in relation to the information being sent...

 regular mono sound carrier is left alone for reception by monaural receivers.

A NICAM-based stereo-TV infrastructure can transmit a stereo TV programme as well as the mono "compatibility" sound at the same time, or can transmit two or three entirely different sound streams. This latter mode could be used to transmit audio in different languages, in a similar manner to that used for in-flight movies on international flights. In this mode, the user can select which soundtrack to listen to when watching the content by operating a "sound-select" control on the receiver.

NICAM offers the following possibilities. The mode is auto-selected by the inclusion of a 3-bit type field in the data-stream
  • One digital stereo sound channel.
  • Two completely different digital mono sound channels.
  • One digital mono sound channel and a 352 kbit/s data channel.
  • One 704 kbit/s data channel.


The four other options could be implemented at a later date. Only the first two of the ones listed are known to be in general use however.

NICAM packet transmission

The NICAM packet (except for the header) is scrambled with a nine-bit pseudo-random bit-generator before transmission.
  • The topology of this pseudo-random generator yields a bitstream with a repetition period of 511 bits.
  • The pseudo-random generator's polynomial is: x^9 + x^4 + 1.
  • The pseudo-random generator is initialized with: 111111111.


Making the NICAM bitstream look more like white noise
White noise
White noise is a random signal with a flat power spectral density. In other words, the signal contains equal power within a fixed bandwidth at any center frequency...

 is important because this reduces signal patterning on adjacent TV channels.
  • The NICAM header is not subject to scrambling. This is necessary so as to aid in locking on to the NICAM data stream and resynchronisation of the data stream at the receiver.
  • At the start of each NICAM packet the pseudo-random bit generator's shift-register is reset to all-ones.

See also

  • Statistical multiplexing
    Statistical multiplexing
    Statistical multiplexing is a type of communication link sharing, very similar to dynamic bandwidth allocation . In statistical multiplexing, a communication channel is divided into an arbitrary number of variable bit-rate digital channels or data streams. The link sharing is adapted to the...

  • Anti-replay
    Anti-replay
    Anti-replay is a sub protocol of IPsec that is part of Internet Engineering Task Force . The main goal of anti-replay is to avoid hackers injecting or making changes in packets that travel from a source to a destination. Anti-replay protocol uses a unidirectional security association in order to...

  • Packet analyzer
  • Gigapackets
    Gigapackets
    Gigapackets are billions of packets or datagrams. The packet is the fundamental unit of information in computer networks.Data transfer rates in gigapackets per second are associated with high speed networks, especially fiber optic networks. The bit rates that are used to create gigapackets are in...

  • Mangled packet
    Mangled packet
    In computer networking, a mangled or invalid packet is a packet — especially IP packet — that either lacks order or self-coherence, or contains code aimed to confuse or disrupt computers, firewalls, routers, or any service present on the network....

  • TCP segment
  • TCP/IP
  • DHCP server
  • Packet generation model
  • Louis Pouzin
    Louis Pouzin
    Louis Pouzin invented the datagram and designed an early packet communications network, CYCLADES...

  • Tail drop
    Tail drop
    Tail Drop, or Drop Tail, is a simple queue management algorithm used by Internet routers to decide when to drop packets. In contrast to the more complex algorithms like RED and WRED, in Tail Drop all the traffic is not differentiated. Each packet is treated identically...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK