Hello

Welcome lekule blog

Hi, I`m Sostenes, Electrical Technician and PLC`S Programmer.
Everyday I`m exploring the world of Electrical to find better solution for Automation.
together in the world. #lekule86
Join us on

The Packet Concept: High-Level Synchronization for Data Links

Learn about (for lack of a better term) packetization, a technique that facilitates robust data transfer in optical, RF, and long-distance-digital communication systems.

Bit-Level vs. High-Level

Successful transfer of binary data requires some method of synchronization between transmitter and receiver. Perhaps the more familiar type of synchronization is what I will call bit-level synchronization. This refers to the fact that the receiver cannot correctly interpret digital data if it does not know when to sample the incoming signal.
Bit-level synchronization is often achieved by means of a shared external clock signal. In the case of a UART interface, two separate internal clocks are used to achieve bit-level synchronization.



However, there is another type of synchronization that is equally critical but not always as obvious. I will refer to this as high-level synchronization—a term that is sufficiently vague to cover the various specific data-transfer situations that I have in mind.

Ones and Zeros vs. Data

Bit-level synchronization ensures that the receiver reliably interprets each transmitted zero or one as an individual zero or one. But we rarely (if ever) are dealing with a digital communication interface in which the receiver accepts a “stream of consciousness” sequence of ones and zeros that can begin and end at any time without compromising the functionality of the system.
Rather, binary data is organized into coherent groups, and successful data transfer requires that the receiver determine both the individual binary values and the original organization of this binary data. A standard way to facilitate this organized transmission of data—in other words, a standard way to achieve high-level synchronization—is the use of packets.

Packets, Packets Everywhere

Don’t take my word for it; let the devices and professional interface protocols speak for themselves. USB, TCP/IP, integrated-circuit RF transceivers, CAN bus, Wi-Fi . . . they all use packetized data transfer.
The packet concept is a straightforward and intuitive approach to achieving high-level synchronization, but it’s not always necessary. I think that the general idea here will become more clear if we first discuss situations in which high-level synchronization is achieved without packetization.

The Alternative

If you have used SPI, you know how to transfer organized data without using packets. SPI has an additional signal, known as slave-select or chip-select. The receiving device knows that the first bit following the active edge of the chip-select signal is the first bit of a coherent group of ones and zeros. All the following bits are organized into individual bytes, fields, status bits, etc. based on the established protocol.



My point here is that an additional high-level synchronization signal can eliminate the need for full-fledged packetization. But an additional signal is often a non-option: RF, optical, and long-distance wired systems are generally expected to incorporate all the necessary synchronization into one transmitted signal.

Anatomy of a Packet

I hesitate to make specific statements about a technique that can be adapted to such a wide variety of applications; nevertheless, I think it is fair to say that the essential components of a packet are the preamble (aka training sequence), the payload, and the checksum.



Preamble

Let’s say you have a 100-byte packet. Each byte is interpreted in a predefined way—e.g., a status byte, a mode-select byte, the first byte in a 32-bit sensor value. Now imagine that the receiver does not recognize the presence of transmitted data until the second bit; in other words, the first bit is skipped. The result? All 100 bytes are lost, because every received byte will be composed of the last 7 bits of one byte and the first bit of the next byte. This example demonstrates the importance of an effective preamble.
The preamble gives the receiver the time and information needed to make all necessary preparations for correctly interpreting the incoming data.
  • Bit-level synchronization must occur during the preamble. As an example, an RF data link might use binary 10101010 as a preamble because the repeated transitions help the receiver to determine the beginning of the modulated bit time.



  • If a receiver relies upon automatic gain control (AGC), the beginning of the packet might be unusable because it takes time for the AGC circuit to find the proper gain. The preamble ensures that the AGC can settle before the payload arrives.
  • We have to keep in mind that it is not always easy for the receiver to know whether it is interpreting signal or noise. An RF link operating near its maximum range might result in a rather puny (and/or noisy) demodulated waveform, and then the receiver must somehow recognize that the noise—which it has perhaps been processing all along, in case the noise is actually signal—has been replaced by a valid transmission. When every single packet begins with the exact same sequence of bits, the receiver can safely ignore all the noise bits, which will generally be random and therefore very unlikely to match the preamble.

 

Payload

The payload is the actual data that the transmitter wants to send to the receiver. It is a series of bits that must be interpreted by the receiver according to the established packet structure.
A related issue that I’ll discuss in this section is packet length. How many payload bytes should be included in one packet? The optimal number varies according to the characteristics of the system. Here are some factors to consider:
  • Do you expect frequent bit errors? If so, a shorter packet length is preferable, because just one flipped bit will cause a checksum failure, and a checksum failure means that the entire packet will be discarded.
  • Are you trying to maximize your data rate? If so, you want longer packets, because each packet introduces overhead bits that decrease the average rate at which meaningful (i.e., payload) data is transferred.
  • Does your receiving device have limited memory? It seems to me that you would usually want the receiver to be able to store an entire packet. Also, if you’re working with a software-defined radio, you might prefer packets that are short enough to allow a digitized baseband waveform for an entire packet to be stored in memory; this makes it possible for you to use a processor that is not powerful enough to decode the baseband signal in real time.

 

Checksum

Obviously, we don’t design a data link for the purpose of transferring erroneous data. But errors are an unavoidable reality of digital communication, so we need something that will help us to discard data that has been corrupted during transmission. The checksum is a byte (for shorter packets) or a sequence of bytes (for longer packets) that allows the receiver to detect errors in the received data.
A widely used and highly effective error-detection mechanism is the cyclic redundancy check (CRC).

Conclusion


Even a basic UART interface can benefit from the techniques involved in packetized data transfer, and you will definitely need to think about packetization for ambitious projects such as a custom RF data link. Just remember, packetization is not only for the prestigious individuals who design protocols like USB and IEEE 802.11—rather, it is a straightforward and versatile concept that would be a valuable addition to many digital communication systems.

Share this:

ABOUTME

Hi all. This is deepak from Bthemez. We're providing content for Bold site and we’ve been in internet, social media and affiliate for too long time and its my profession. We are web designer & developer living India! What can I say, we are the best..

Post a Comment
My photo

Hi, I`m Sostenes, Electrical Technician and PLC`S Programmer.
Everyday I`m exploring the world of Electrical to find better solution for Automation. I believe everyday can become a Electrician with the right learning materials.
My goal with BLOG is to help you learn Electrical.

Labels

LEKULE TV EDITORIALS ARTICLES DC ROBOTICS DIGITAL SEMICONDUCTORS GENERATOR AC EXPERIMENTS MANUFACTURING-ENGINEERING REFERENCE FUNDAMENTAL OF ELECTRICITY ELECTRONICS ELECTRICAL ENGINEER MEASUREMENT TRANSDUCER & SENSOR VIDEO ARDUINO RENEWABLE ENERGY AUTOMOBILE TEARDOWN SYNCHRONOUS GENERATOR DIGITAL ELECTRONICS ELECTRICAL DISTRIBUTION CABLES AUTOMOTIVE MICROCONTROLLER SOLAR PROTECTION DIODE AND CIRCUITS BASIC ELECTRICAL ELECTRONICS MOTOR SWITCHES CIRCUIT BREAKERS CIRCUITS THEORY PANEL BUILDING ELECTRONICS DEVICES MIRACLES SWITCHGEAR ANALOG MOBILE DEVICES WEARABLES CAMERA TECHNOLOGY COMMUNICATION GENERATION BATTERIES FREE CIRCUITS INDUSTRIAL AUTOMATION SPECIAL MACHINES ELECTRICAL SAFETY ENERGY EFFIDIENCY-BUILDING DRONE CONTROL SYSTEM NUCLEAR ENERGY SMATRPHONE FILTER`S POWER BIOGAS BELT CONVEYOR MATERIAL HANDLING RELAY ELECTRICAL INSTRUMENTS ENERGY SOURCE PLC`S TRANSFORMER AC CIRCUITS CIRCUIT SCHEMATIC SYMBOLS DDISCRETE SEMICONDUCTOR CIRCUITS WIND POWER C.B DEVICES DC CIRCUITS DIODES AND RECTIFIERS FUSE SPECIAL TRANSFORMER THERMAL POWER PLANT CELL CHEMISTRY EARTHING SYSTEM ELECTRIC LAMP FUNDAMENTAL OF ELECTRICITY 2 BIPOLAR JUNCTION TRANSISTOR 555 TIMER CIRCUITS AUTOCAD BLUETOOTH C PROGRAMMING HOME AUTOMATION HYDRO POWER LOGIC GATES OPERATIONAL AMPLIFIER`S SOLID-STATE DEVICE THEORRY COMPUTER DEFECE & MILITARY FLUORESCENT LAMP INDUSTRIAL ROBOTICS ANDROID ELECTRICAL DRIVES GROUNDING SYSTEM CALCULUS REFERENCE DC METERING CIRCUITS DC NETWORK ANALYSIS ELECTRICAL SAFETY TIPS ELECTRICIAN SCHOOL ELECTRON TUBES FUNDAMENTAL OF ELECTRICITY 1 INDUCTION MACHINES INSULATIONS USB ALGEBRA REFERENCE HMI[Human Interface Machines] INDUCTION MOTOR KARNAUGH MAPPING USEUL EQUIATIONS AND CONVERSION FACTOR ANALOG INTEGRATED CIRCUITS BASIC CONCEPTS AND TEST EQUIPMENTS DIGITAL COMMUNICATION DIGITAL-ANALOG CONVERSION ELECTRICAL SOFTWARE GAS TURBINE ILLUMINATION OHM`S LAW POWER ELECTRONICS THYRISTOR BOOLEAN ALGEBRA DIGITAL INTEGRATED CIRCUITS FUNDAMENTAL OF ELECTRICITY 3 PHYSICS OF CONDUCTORS AND INSULATORS SPECIAL MOTOR STEAM POWER PLANTS TESTING TRANSMISION LINE C-BISCUIT CAPACITORS COMBINATION LOGIC FUNCTION COMPLEX NUMBERS CONTROL MOTION ELECTRICAL LAWS INVERTER LADDER DIAGRAM MULTIVIBRATORS RC AND L/R TIME CONSTANTS SCADA SERIES AND PARALLEL CIRCUITS USING THE SPICE CIRCUIT SIMULATION PROGRAM AMPLIFIERS AND ACTIVE DEVICES APPS & SOFTWARE BASIC CONCEPTS OF ELECTRICITY CONDUCTOR AND INSULATORS TABLES CONDUITS FITTING AND SUPPORTS ELECTRICAL INSTRUMENTATION SIGNALS ELECTRICAL TOOLS INDUCTORS LiDAR MAGNETISM AND ELECTROMAGNETISM PLYPHASE AC CIRCUITS RECLOSER SAFE LIVING WITH GAS AND LPG SAFETY CLOTHING STEPPER MOTOR SYNCHRONOUS MOTOR AC METRING CIRCUITS BECOME AN ELECTRICIAN BINARY ARITHMETIC BUSHING DIGITAL STORAGE MEMROY ELECTRICIAN JOBS HEAT ENGINES HOME THEATER INPECTIONS LIGHT SABER MOSFET NUMERATION SYSTEM POWER FACTORS REACTANCE AND IMPEDANCE INDUCTIVE RECTIFIER AND CONVERTERS RESONANCE SCIENTIFIC NOTATION AND METRIC PREFIXES SULFURIC ACID TROUBLESHOOTING TROUBLESHOOTING-THEORY & PRACTICE 12C BUS APPLE BATTERIES AND POWER SYSTEMS DC MOTOR DRIVES ELECTROMECHANICAL RELAYS ENERGY EFFICIENCY-LIGHT INDUSTRIAL SAFETY EQUIPMENTS MEGGER MXED-FREQUENCY AC SIGNALS PRINCIPLE OF DIGITAL COMPUTING QUESTIONS REACTANCE AND IMPEDANCE-CAPATIVE SEQUENTIAL CIRCUITS SERRIES-PARALLEL COMBINATION CIRCUITS SHIFT REGISTERS WIRELESS BUILDING SERVICES COMPRESSOR CRANES DIVIDER CIRCUIT AND KIRCHHOFF`S LAW ELECTRICAL DISTRIBUTION EQUIPMENTS 1 ELECTRICAL DISTRIBUTION EQUIPMENTS B ELECTRICAL TOOL KIT ELECTRICIAN JOB DESCRIPTION INDUSTRIAL DRIVES LAPTOP SCIENCE THERMOCOUPLE TRIGONOMENTRY REFERENCE UART oscilloscope BIOMASS CONTACTOR ELECTRIC ILLUMINATION ELECTRICAL SAFETY TRAINING ELECTROMECHANICAL FEATURED FILTER DESIGN HARDWARE JUNCTION FIELD-EFFECT TRANSISTORS NASA NUCLEAR POWER VALVE COLOR CODES ELECTRIC TRACTION FLEXIBLE ELECTRONICS FLUKE GEARMOTORS INTRODUCTION LASSER PID PUMP SEAL ELECTRICIAN CAREER ELECTRICITY SUPPLY AND DISTRIBUTION MUSIC NEUTRAL PERIODIC TABLES OF THE ELEMENTS POLYPHASE AC CIRCUITS PROJECTS REATORS SATELLITE STAR DELTA VIBRATION WATERPROOF