HOME

TheInfoList



OR:

A bitstream (or bit stream), also known as binary sequence, is a sequence of bits. A bytestream is a sequence of
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable uni ...
s. Typically, each byte is an 8-bit quantity, and so the term octet stream is sometimes used interchangeably. An octet may be encoded as a sequence of 8 bits in multiple different ways (see bit numbering) so there is no unique and direct translation between bytestreams and bitstreams. Bitstreams and bytestreams are used extensively in telecommunications and
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
. For example, synchronous bitstreams are carried by SONET, and
Transmission Control Protocol The Transmission Control Protocol (TCP) is one of the main protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, the entire suite is commonl ...
transports an asynchronous bytestream.


Relationship between bitstreams and bytestreams

In practice, bitstreams are not used directly to encode bytestreams; a communication channel may use a signalling method that does not directly translate to bits (for instance, by transmitting signals of multiple frequencies) and typically also encodes other information such as framing and error correction together with its data.


Examples

The term bitstream is frequently used to describe the configuration data to be loaded into a field-programmable gate array (FPGA). Although most FPGAs also support a byte-parallel loading method as well, this usage may have originated based on the common method of configuring the FPGA from a serial bit stream, typically from a serial PROM or flash memory chip. The detailed format of the bitstream for a particular FPGA is typically proprietary to the FPGA vendor. In mathematics, several specific infinite sequences of bits have been studied for their mathematical properties; these include the Baum–Sweet sequence, Ehrenfeucht–Mycielski sequence, Fibonacci word, Kolakoski sequence, regular paperfolding sequence, Rudin–Shapiro sequence, and Thue–Morse sequence. On most operating systems, including Unix-like and Windows, standard I/O libraries convert lower-level paged or buffered file access to a bytestream paradigm. In particular in Unix-like operating systems, each process has three standard streams, that are examples of unidirectional bytestreams. The Unix pipe mechanism provides bytestream communications between different processes. Compression algorithms often code in bitstreams, as the 8 bits offered by a byte (the smallest addressable unit of memory) may be wasteful. Although typically implemented in low-level languages, some high-level languages such as Python and Java offer native interfaces for bitstream I/O. One well-known example of a communication protocol which provides a byte-stream service to its clients is the
Transmission Control Protocol The Transmission Control Protocol (TCP) is one of the main protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, the entire suite is commonl ...
(TCP) of the Internet protocol suite, which provides a bidirectional bytestream. The Internet media type for an arbitrary bytestream is . Other media types are defined for bytestreams in well-known formats.


Flow control

Often the contents of a bytestream are dynamically created, such as the data from the keyboard and other peripherals (/dev/tty), data from the pseudorandom number generator (
/dev/urandom In Unix-like operating systems, and are special files that serve as cryptographically secure pseudorandom number generators. They allow access to environmental noise collected from device drivers and other sources. typically blocked if th ...
), etc. In those cases, when the destination of a bytestream (the consumer) uses bytes faster than they can be generated, the system uses
process synchronization In computer science, synchronization refers to one of two distinct but related concepts: synchronization of processes, and synchronization of data. ''Process synchronization'' refers to the idea that multiple processes are to join up or handsha ...
to make the destination wait until the next byte is available. When bytes are generated faster than the destination can use them, there are several techniques to deal with the situation: * When the producer is a software algorithm, the system pauses the producer with the same process synchronization techniques. * When the producer supports flow control, the system only sends the ''ready'' signal when the consumer is ready for the next byte. * When the producer can't be paused—it is a keyboard or some hardware that doesn't support flow control—the system typically attempts to temporarily store the data until the consumer is ready for it, typically using a queue. Often the receiver can empty the buffer before it gets completely full. A producer that continues to produce data faster than it can be consumed, even after the buffer is full, leads to unwanted buffer overflow,
packet loss Packet loss occurs when one or more packets of data travelling across a computer network fail to reach their destination. Packet loss is either caused by errors in data transmission, typically across wireless networks, or network congestion.Ku ...
, network congestion, and
denial of service In computing, a denial-of-service attack (DoS attack) is a cyber-attack in which the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host conne ...
.


See also

* Bit banging * Bit-stream access *
Bitstream format A bitstream format is the format of the data found in a stream of bits used in a digital communication or data storage application. The term typically refers to the data format of the output of an encoder, or the data format of the input to a d ...
* Byte-oriented protocol * MPEG elementary stream *
Reliable byte stream A reliable byte stream is a common service paradigm in computer networking; it refers to a byte stream in which the bytes which emerge from the communication channel at the recipient are exactly the same, and in exactly the same order, as they we ...
* Stream (computing) * Stream processing * Traffic flow (computer networking)


References

{{Reflist Data transmission Reconfigurable computing