The Manchester-II code or the Manchester code is most widely used in local networks. It also refers to self-synchronizing codes, but unlike the RZ code, it has not three, but only two levels, which provides better noise immunity.

A logical zero corresponds to a transition to the upper level in the center of the bit interval, a logical one corresponds to a transition to the lower level. The coding logic is clearly visible in the example of transmitting a sequence of ones or zeros. When transmitting interleaved bits, the pulse repetition rate is halved.

Information transitions remain in the middle of a bit, while boundary transitions (on the border of bit intervals) are absent when alternating ones and zeros. This is done with a sequence of inhibiting pulses. These pulses are synchronized with the information pulses and ensure that unwanted boundary transitions are prohibited.

Changing the signal at the center of each bit makes it easy to isolate the clock signal. Self-synchronization makes it possible to transmit large packets of information without loss due to differences in the clock frequency of the transmitter and receiver.

Figure.7.3 Two-level Manchester-II code.

A great advantage of the Manchester code is the absence of a constant component when transmitting a long sequence of ones or zeros. Due to this, the galvanic isolation of signals is carried out in the simplest ways, for example, using pulse transformers.

An important characteristic of the Manchester code is that the signal does not have a constant component when transmitting a long sequence of ones or zeros. This allows transmitters and receivers to be galvanically isolated using pulse transformers.

frequency spectrum The signal in Manchester encoding includes only two carrier frequencies. For a ten-megabit protocol, this is 10 MHz when transmitting a signal consisting of one zeros or one ones, and 5 MMHz for a signal with alternating zeros and ones. Therefore, bandpass filters can easily filter out all other frequencies.

Advantages of the Manchester code:

  • the code is self-synchronizing, since there is necessarily a transition in the middle of a bit,
  • there is no DC component in the Manchester code signal, this makes it possible to use for galvanic isolation pulse transformers (galvanic isolation performed by the network card).

Disadvantage of Manchester code:

  • as with the RZ code, twice the bandwidth is required than with the NRZ code at the same bit rate.

The Manchester-II code has found application in fiber optic and electrical wire networks. The most common 10 Mbps Ethernet LAN protocol uses this code.

So, to begin with, let's talk about what constitutes "Manchester" coding.

In the "Manchester" code, the unit is encoded by the transition of the signal in the middle of the bit interval from the state "OFF" to the state "ON", and zero - vice versa, by the transition of the signal in the middle
bit interval from the "ON" state to the "OFF" state.

What are the "ON" and "OFF" states?
The signal states "ON" and "OFF" are brain teaser states. In general, "OFF" is an inactive state, the same as in the absence of any exchange at all, and "ON" is an active state, that is, one that is somehow different from inactive. Therefore, despite the fact that in the picture on the right the “ON” signal state is shown by a high signal level, and the “OFF” state is shown by a low level, this should not be taken literally (it’s just that the picture is more familiar and clearer with high and low levels). In fact, the "ON" and "OFF" states can be encoded in completely different ways. For example, IR remotes encode these states by the presence or absence of pulses at a certain frequency, integrated photodetectors (which most often have a high output signal level inactive) issue a code in which “ON” is encoded by a low level, and “OFF” is encoded by a high level, and etc.

The duration of zero and one in Manchester encoding is the same, that is, the length of the message does not depend on how many zeros or ones are in the message, but depends only on the total number of bits.

The key property of Manchester coding is that both signal states are necessarily present during the transmission of each bit: “ON” and “OFF” (again, look at the figure above). That is, during the transmission of each bit, the signal must change its state at least once. That is, the “Manchester” code can only consist of single intervals, if adjacent bits are the same, and double, if adjacent bits are different, duration (this is shown in the figure on the left).

The described property allows you to additionally synchronize the receiver with the transmitter when each bit is received, determine whether the received code can be “Manchester” at all, diagnose the end of the message or the “loss” of the transmitter signal.

Say, if we assume that the frequency of the transmitter cannot jump by more than 1.5 times, then the absence of a change in the state of the signal within 3 half-bits can be safely interpreted as the end of the message or the “loss” of the transmitter signal (if we know the length of the message in advance ). Or, for example, when examining some unknown code, if we see that there are more than two options for the intervals between the “ON” and “OFF” states in the code, then we can unambiguously conclude that the code under study is not “Manchester”.

I hope that everything is more or less clear with what the "Manchester" code is, so let's move on to the next question - how to receive and decode this code.

Well, obviously, you can determine the start of data transmission by changing the state of the signal perceived by the receiver from “OFF” to “ON”. However, there is one caveat. Since the transfer of one also starts from the “OFF” state, then when the signal changes from “OFF” to “ON” for the first time, we will absolutely not be able to diagnose whether this is the middle of the transfer of one or the beginning of the transfer of zero. The only thing that can be done here is to agree in advance which bit should be transmitted first (that is, introduce a special start bit, the value of which will always be strictly defined).

That's it, now, if we know which bit the message starts from, we know the duration of the intervals of the "ON" and "OFF" states, our receiver has an accurate, stable generator and we
we know exactly how many bits we want to receive, then we can compose the first simplest algorithm for restoring the original, encoded by the "Manchester" code of the package:

  1. - start recording the value of the signal. From this moment onwards at intervals equal to the duration of the bit. And so - until the required number of bits is obtained.

Option two. We know what bit the message starts from, we know the duration of the “ON” and “OFF” intervals, our receiver has a stable generator, but we do not know anything about the length of the message. In this case, you can use the property of the Manchester code that the signal cannot remain constant for 3 or more half-bits. That is, the moment when the signal remains in the “OFF” state for 3 half-bits can be considered the end of the message. The source code recovery algorithm in this case may look like this:

  1. - by changing the state of the signal from "OFF" to "ON", we determine the beginning of the transmission
  2. - count off a quarter of the duration of the bit (to get into the middle of the half-bit)
  3. - from this moment (let it be moment number 1) and further, at intervals equal to the duration of a half-bit, we analyze the value of the signal. Once
    it will happen that the signal in the last three measurements will be in the “OFF” state - this will signal the end of the message. In addition, by recording the value of the signal at all times with odd numbers, except for the last one, we will restore the original message.

Option three. We know which bit the message starts from, but we do not know the duration of the intervals during which the signal is in the “ON” and “OFF” states. What should we do in
this case? If, by a lucky chance, you know the value of not only the first bit, but also the second one, then you know exactly at what intervals (in a whole bit or in half)
the first 2 switchings will occur and you can easily detect the necessary intervals or, scientifically speaking, synchronize the receiver with the transmitter.
(Yeah, so we figured out why they have as many as 2 start bits. By the way, in ethernet networks, where Manchester encoding is also used, a whole 56-bit preamble is used for initial synchronization).
Then you can easily use the first or second of the above algorithms.

Well, suppose there is another option. We know the first two bits of the message, but our generator is complete shit, although it works (or, in scientific terms, we can guarantee that in a time equal to the duration of a half-bit, the frequency of the generator cannot change by 1.5 times or more). Here's how to be?

Yes, you just need to re-calculate the values ​​​​of the duration of a half-bit and a whole bit for each new front. That is, in other words, it is necessary to synchronize the receiver with the transmitter not once at the very beginning, but on each new front (by the front we mean switching between the “ON” / “OFF” states), since with Manchester coding we have a new front in each transmitted bit.

In short, consider different combinations you can do it for a long time, remember the main advantage for which the “Manchester” code is so loved by everyone: when transmitting each bit, there is a change in the “ON” / “OFF” state, which makes it possible to synchronize the transmitter and receiver.

In addition to the above, there is also the so-called "difference" or "differential" "Manchester" coding. In this case, when zero is transmitted, the bit interval begins with a change in the signal state to the opposite, and when one is transmitted, the signal state at the beginning of the bit interval does not change. Otherwise, everything is the same as in the usual "Manchester" coding - in the middle of the bit interval, the signal state necessarily changes to the opposite (see the figure on the left).

The EM4100 tag stores 64 bits of data, which means that the design must contain a 64-bit shift register made up of eight 8-bit 74HC165 registers. The register is reset after every 64 shifts to reset the data and start over. The data at the register inputs are as follows:
  • Timing pattern: nine units
  • Manufacturer/Version ID: 2 blocks of 5 bits, of which 4 bits are data and the 5th bit is parity
  • Unique identifier: 8 blocks of 5 bits, of which 4 bits are data and the fifth is parity
  • Checksum: 4 parity bits counted by columns
  • Stop bit: "0"

Even encrypted labels are vulnerable to many attacks. In addition, it is becoming increasingly easier to emulate tags on smartphones with NFC support(which usually operate at 13.56 MHz). Just write the field modulation application correctly and you can do whatever you want.

As a standard excuse, let me remind you that the author (And a translator! - Note. transl.) assumes no responsibility for the consequences of using the information from this article. The reader must be responsible for all his actions.

Frame

Sometimes very lucky. A beautiful case would not hurt right now, when the prototype is finished and the printed circuit board is ordered. And it was at this time that Fleming finished assembling and started the machine laser cutting OSAA PhotonSaw. After a year of work on the project, the laser is ready to cut its first parts. Flemming and Rune make final adjustments and replace the laser cabinet's aluminum cover. You can imagine how happy we all were to see this thing work.

With the machine running, we were able to test our project in real life. The body for our RFID tag is made from 2mm plexiglass. This body is the first object made on PhotonSaw, yes!

The idea was born to place the coil on the outside of the case. At first it was decided to use half the height of the hull, but this did not work in practice (the extra holes in the long sides are thus not used). The coil fits perfectly around the perimeter of the entire case, although I had doubts whether the rectangular winding (105x55 mm) would be too large for normal electromagnetic coupling.

The test coil was wound, without any calculations, with 0.4 mm wire in 66 turns. And, obviously, we were lucky again, because the coil turned out exactly as it should, with an inductance of 645 μH, with a connected label giving resonant frequency 125.2 kHz. A door reader test showed that the prototype worked just fine with this coil.

With the coil on the outside of the case, the thickness of the latter can be reduced. The internal thickness now depends only on the height of the parts on the board, and taking into account the board thickness should be about 6 mm. In addition, it would be nice to add engraving. Flemming suggested rounding the sides of the case for aesthetic and ergonomic reasons. A curved body will also better protect the sides of the coil, because where there is not a lot of tension, the coils of wire like to crawl out.

The PhotonSaw is not quite up to par yet: engraving on top cover moved out significantly. It is necessary to finalize it before making the final version of the case. Curved contours were also subject to a calculation error in the software, as the beam did not return to its initial position after passing through a closed path. But anyway, the curves look really smooth.

PCB Assembly

Ordered board arrived:

Assembly was not very difficult. Solder paste was applied to the stenciled board, all the details were placed, and then soldered in a homemade oven.

Through the separating capacitance (47 pF have a resistance of approximately 27 kOhm at a frequency of 125 kHz) and protective diodes, the current flows to the power buses. The energy coming from the coil is enough to maintain the supply voltage of about 1 V. The current can reach 250-500 μA. Surprisingly, the 74HC chips seem to work with this power supply. Unfortunately, under such pressure, strange things happen. The 74HCs have an internal reset circuit and you need to make sure it works. Note that turning off the protection diodes does not help. There are internal protective diodes at the inputs of the microcircuits, which in this case open and do the same job.

A power reset is only triggered if the power supply voltage drops below a certain level for a certain period of time. If the voltage remains too high, then the internal logic can become confused because some parts of it may be in an undefined state while others are working properly. An internal reset is required to set all chips to a consistent state. Thus, the circuit will operate erratically at a very low supply voltage.

The following symptoms were observed: the tag works for a while, while sending the correct data. If the coil is removed from the reader and then put back in, you can bet on whether the tag will turn off. Sometimes it works, sometimes it doesn't. Turning off the PLL worsens the situation. Low power consumption causes the reader to occasionally receive data from a disabled tag. That's what "energy efficient system" means.

There are two solutions: 1) reduce the capacitor in the clock recovery circuit to 15 pF, and 2) add a 22-100 kΩ resistor between power and ground to drain excess energy. The second method leads to an increase in leakage during operation and is not really required when reducing the capacitance of the capacitor. However, it is provided as an option, and it is still better than the indeterminate state of the chips.

Modulation by current or voltage

The modulator brought a fresh portion of a headache. The modulation completely disappeared when the coil was placed at a certain distance from the reader. It could also happen when moving the coil towards or away from the reader.

The reason turned out to be in the modulator circuit. MOSFETs close the coil to a resistor of a certain resistance. However, if the power draw from the loop is high, the modulator resistance is much higher than the resistance of the supply circuits. This leads to the fact that the depth of modulation depends on the consumed current, and this is not very good. The situation was worsened by the choice of a restrictive zener diode at a lower voltage than in the prototype.

It was decided to transfer the modulator from the voltage modulation mode to the current modulation mode. For the first mode, the resistor was in the drain circuit, and now it is connected between the source and ground. The gate-source voltage will drop across this resistor until a value remains slightly above the transistor opening threshold (0.9-1.1 V), which will put the transistor into linear mode. Now the current through the transistor will be stable, regardless of the drain voltage.

Prototype testing has shown that current modulation works very well. The cheap nameless reader no longer fails (okay, maybe once in a hundred or so). We can assume that this change will work wonderfully on other readers, and the label will now probably be able to work on most of them.

Finished version 1

You can see the changes in printed circuit board. I did not have a 15 pF SMD capacitor, I had to solder a regular one with legs. The modulator is overgrown with additional resistors at the sources of the transistors. Generally acceptable for the first version.

(pictures are clickable)





Video demonstration

Conclusion

You might think that this project, built on 7400 logic, can be attributed to retro circuitry, but this is not entirely true. First, the modern 74HC family is not that old. Secondly, low-power schemes are always relevant. Third, single chip logical elements(such as the used Schmitt trigger) are often used in modern developments. It is often forgotten that the development of technology does not stop even for older families of microcircuits. They just became less noticeable against the background of the general diversity.

The analog part turned out to be more difficult to develop than the digital part. Partly due to the lack of specifications, but mainly due to the many compromises required to meet the parameters and unforeseen side effects. Digital designs have relatively few options, while analog designs usually require a balance between different (and often opposing) criteria.

I must confess that the 74HC chips are very, very well made. The developers knew what they were doing and achieved very low power consumption. At first I had some doubts whether the tag would be passive powered, but after reading the specs it was just a matter of proper circuit design. Although, there is still room for optimization of different parts of the label.

Now let's see how this project performs in the 2012 7400 competition. Submission of applications for the competition ends on November 31. We wish the author good luck! - Note. transl.

Tags: Add tags

Manchester code

In local networks, until recently, the most common coding method was the so-called Manchester code(Fig. 2.16, d). It is used in Ethernet and Token Ring technologies.

In the Manchester code, a potential drop, that is, the front of the pulse, is used to encode ones and zeros. In Manchester encoding, each clock is divided into two parts. Information is encoded by potential drops that occur in the middle of each cycle. A unit is encoded by a low-to-high transition, and a zero is encoded by a reverse edge. At the beginning of each cycle, a service signal edge can occur if you need to represent several ones or zeros in a row. Since the signal changes at least once per transmission cycle of one data bit, the Manchester code has good self-synchronizing properties. The bandwidth of the Manchester code is narrower than that of the bipolar pulse. It also does not have a DC component, and the fundamental harmonic in the worst case (when transmitting a sequence of ones or zeros) has a frequency of N Hz, and in the best case (when transmitting alternating ones and zeros) it is equal to N / 2 Hz, like in AMI codes or NRZ. On average, the bandwidth of the Manchester code is one and a half times narrower than that of the bipolar pulse code, and the fundamental harmonic oscillates around 3N/4. The Manchester code has another advantage over the bipolar pulse code. The latter uses three signal levels for data transmission, while Manchester uses two.

Potential code 2B1Q

On fig. 2.16e shows a potential code with four signal levels for data encoding. This is the code 2B1Q, the name of which reflects its essence - every two bits (2V) are transmitted in one cycle by a signal that has four states (1Q), A pair of bits 00 corresponds to a potential of -2.5 V, a pair of bits 01 corresponds to a potential of -0.833 V, a pair of 11 - a potential +0.833 V, and pair 10 - +2.5 V potential. With this encoding method, additional measures are required to combat long sequences of identical bit pairs, since the signal is then converted to a constant component. With random bit interleaving, the spectrum of the signal is twice as narrow as that of the NRZ code, since at the same bit rate the clock duration is doubled. Thus, using the 2B1Q code, you can transfer data over the same line twice as fast as using the AMI or NRZI code. However, for its implementation, the transmitter power must be higher so that the four levels are clearly distinguished by the receiver against the background of interference.

2.2.3. Logic coding

Logic coding is used to improve potential AMI, NRZI or 2Q1B type codes. Logic coding should replace long sequences of bits leading to a constant potential with interspersed ones. As noted above, two methods are characteristic of logical coding - redundant codes and scrambling.

Redundant codes

Redundant codes are based on splitting the original sequence of bits into portions, which are often called characters. Then each original character is replaced with a new one that has more bits than the original. For example, logic code 4V/5V, used in FDDI and Fast Ethernet technologies, replaces the original 4-bit characters with 5-bit characters. Since the resulting symbols contain redundant bits, the total number of bit combinations in them is greater than in the original ones. So, in the 4B / 5B code, the resulting symbols can contain 32 bit combinations, while the original symbols - only 16. Therefore, in the resulting code, you can select 16 such combinations that do not contain a large number of zeros, and count the rest prohibited codes (code violation). In addition to removing DC and making the code self-synchronizing, redundant codes allow the receiver to recognize corrupted bits. If the receiver receives a forbidden code, it means that the signal has been distorted on the line.

Correspondence of source and resulting codes 4V/5V is presented below.

The 4B/5B code is then transmitted over the line using physical coding in one of the potential coding methods that is only sensitive to long sequences of zeros. The 4V/5V code symbols, 5 bits long, guarantee that with any combination of them, more than three consecutive zeros cannot occur on the line.

The letter B in the code name means that the elementary signal has 2 states - from English binary - binary. There are also codes with three signal states, for example, in the 8B/6T code for 8-bit coding background information a code of 6 signals is used, each of which has three states. The redundancy of the 8B/6T code is higher than that of the 4B/5B code, since there are 3 6 =729 resulting symbols per 256 source codes.

Using the lookup table is a very simple operation, so this approach does not complicate network adapters and interface blocks of switches and routers.

To ensure the given bandwidth line, a transmitter using a redundant code must operate at an increased clock rate. So, to transmit 4V / 5V codes at a rate of 100 Mb / s, the transmitter must operate at a clock frequency of 125 MHz. In this case, the spectrum of the signal on the line is expanded in comparison with the case when a pure, non-redundant code is transmitted over the line. Nevertheless, the spectrum of the redundant potential code turns out to be narrower than the spectrum of the Manchester code, which justifies the additional stage of logical coding, as well as the operation of the receiver and transmitter at an increased clock frequency.

Scrambling

Shuffling the data with a scrambler before putting it on the line with a candid code is another way of logical coding.

Scrambling methods consist in bit-by-bit calculation of the resulting code based on the bits of the source code and the bits of the resulting code received in previous cycles. For example, a scrambler might implement the following relationship:

where Bi is the binary digit of the resulting code obtained at the i-th cycle of the scrambler, Ai is the binary digit of the source code that arrives at the i-th cycle at the input of the scrambler, Bi-3 and Bi-5 are the binary digits of the resulting code obtained at the previous cycles of the scrambler, respectively, 3 and 5 cycles earlier than the current cycle, the XOR operation (modulo 2 addition). For example, for the source sequence 110110000001, the scrambler will give the following result code: B1 = A1 = 1 (the first three digits of the result code will be the same as the original one, since there are no necessary previous digits yet)

Thus, the output of the scrambler will be the sequence 110001101111, which does not contain the sequence of six zeros that was present in source code.

After receiving the resulting sequence, the receiver passes it to the descrambler, which reconstructs the original sequence based on the inverse relationship:

Various scrambling algorithms differ in the number of terms that give the digit of the resulting code, and the shift between the terms. So, in ISDN networks, when transferring data from a network to a subscriber, a transformation is used with shifts of 5 and 23 positions, and when transferring data from a subscriber to a network, with shifts of 18 and 23 positions.

There are more simple methods fight against sequences of units, also referred to the class of scrambling.

To improve the Bipolar AMI code, two methods are used based on the artificial distortion of the sequence of zeros by forbidden characters.

On fig. Figure 2.17 shows the use of the B8ZS (Bipolar with 8-Zeros Substitution) method and the HDB3 (High-Density Bipolar 3-Zeros) method to correct the AMI code. The source code consists of two long sequences of zeros: in the first case - from 8, and in the second - from 5.

Rice. 2.17. Codes B8ZS and HDB3. V - signal of the forbidden polarity unit; 1*-signal of a unit of correct polarity, but replacing 0 in the source code

The B8ZS code corrects only sequences consisting of 8 zeros. To do this, after the first three zeros, instead of the remaining five zeros, he inserts five digits: V-1*-0-V-1*. V here denotes a signal of one, forbidden for a given cycle of polarity, that is, a signal that does not change the polarity of the previous one, 1* is a signal of a unit of correct polarity, and the asterisk sign marks the fact that in the source code in this cycle there was not a unit, but zero . As a result, the receiver sees 2 distortions in 8 clock cycles - it is very unlikely that this happened due to noise on the line or other transmission failures. Therefore, the receiver considers such violations as coding of 8 consecutive zeros and, upon reception, replaces them with the original 8 zeros. The B8ZS code is constructed in such a way that its constant component is zero for any sequence of binary digits.

Lecture 4: OSI Model

  1. Layers and process of communication in the OSI model

  2. Interaction of levels in the process of communication

For a unified representation of data in networks with heterogeneous devices and software, the International Standards Organization (ISO) has developed a basic communication model open systems OSI (Open System Interconnect). This model describes the rules and procedures for transferring data in various network environments when organizing a communication session. The main elements of the model are layers, application processes and physical means of connection. On fig. 2.1 shows the structure of the basic model. Each level of the model OSI performs a specific task in the process of transmitting data over a network. base model is the basis for the development of network protocols. OSI divides communication functions in a network into seven layers, each of which serves a different part of the open systems interoperability process.

Rice. 2.1 OSI Model

The OSI model only describes system-wide means of interaction, not end-user applications. Applications implement their own communication protocols by accessing system facilities. If an application can take over the functions of some of the upper layers of the OSI model, then for communication it accesses directly the system tools that perform the functions of the remaining lower layers of the OSI model.

Interaction of layers of the OSI model

The OSI model can be divided into two different models, as shown in Figure 2.2:

    a horizontal protocol-based model that provides a mechanism for the interaction of programs and processes on different machines;

    a vertical model based on services provided by neighboring layers to each other on the same machine.

Rice. 2.2 The scheme of interaction of computers in the basic OSI reference model

Each layer of the sending computer interacts with the same layer of the receiving computer as if it were directly connected. Such a relationship is called a logical or virtual connection. In fact, the interaction is carried out between adjacent levels of one computer.

So, the information on the sending computer must pass through all levels. It is then transmitted over the physical medium to the receiving computer and again passes through all the layers until it reaches the same level from which it was sent on the sending computer.

AT horizontal model the two programs need a common protocol to exchange data. In a vertical model, adjacent layers communicate using Application Programming Interfaces (APIs).

Before being fed into the network, the data is broken into packets. A packet is a unit of information transmitted between stations on a network. When sending data, the packet passes sequentially through all levels software. At each level, control information of this level (header) is added to the packet, which is necessary for successful data transmission over the network, as shown in Fig. 2.3, where Zag- packet header, Kon- end of packet.

On the receiving side, the packet goes through all the layers in reverse order. At each layer, the protocol at that layer reads the packet's information, then removes the information added to the packet at the same layer by the sender, and passes the packet to the next layer. When the package reaches Applied level, all control information will be removed from the packet, and the data will return to its original form.

Rice. 2.3 Formation of a package of each level of the seven-level model

Each level of the model has its own function. The higher the level, the more difficult task he decides.

Separate model levels OSI convenient to consider as program groups designed to perform specific functions. One layer, for example, is responsible for providing data transformation from ASCII in EBCDIC and contains programs necessary to complete this task.

Each layer provides a service to a higher layer, in turn requesting a service from the lower layer. The upper layers request a service in much the same way: as a rule, it is a requirement to route some data from one network to another. The practical implementation of the principles of data addressing is assigned to the lower levels.

The considered model determines the interaction of open systems different manufacturers in the same network. Therefore, it performs coordinating actions for them on:

    interaction of applied processes;

    data presentation forms;

    uniform data storage;

    network resource management;

    data security and information protection;

    diagnostics of programs and hardware.

On fig. 2.4 given short description functions at all levels.

Rice. 2.4 Level functions

Application layer

The application layer provides application processes with access to the interaction area, is the upper (seventh) level and is directly adjacent to application processes. In fact, the application layer is a set of various protocols by which network users access shared resources such as files, printers, or hypertext Web pages, and also organize their joint work, for example, using the protocol Email. Special application service elements provide services for specific application programs such as file transfer and terminal emulation programs. If, for example, the program needs to send files, then it will definitely be used file transfer, access and management protocol FTAM ( File Transfer, Access, and Management). In the OSI model application program, which needs to perform a specific task (for example, update a database on a computer), sends specific data in the form datagrams on the application layer. One of the main tasks of this layer is to determine how an application request should be processed, in other words, what form the request should take.

The unit of data that the application layer operates on is usually called a message.

The application layer performs the following functions:

Description of forms and methods of interaction between applied processes.

    Performance various kinds works.

    file transfer;

    job management;

    system management, etc.

    Identification of users by their passwords, addresses, electronic signatures;

    Identification of functioning subscribers and the possibility of access to new application processes;

    Determining the sufficiency of available resources;

    Organization of connection requests with other application processes;

    Transfer of applications to the representative level for the necessary methods of information description;

    Selection of procedures for the planned dialogue of processes;

    Management of data exchanged between application processes and synchronization of interaction between application processes;

    Determining the quality of service (delivery time of data blocks, acceptable error rate);

    Agreement on the correction of errors and the determination of the reliability of data;

    Coordination of restrictions imposed on the syntax (character sets, data structure).

These functions define the kinds of services that the application layer provides to application processes. In addition, the application layer transfers to application processes the service provided by the physical, link, network, transport, session and presentation layers.

On the application layer it is necessary to provide users with already processed information. This can be handled by system and user software.

The application layer is responsible for accessing applications to the network. The tasks of this level are file transfer, exchange postal messages and network management.

The most common top three layer protocols are:

    FTP (File Transfer Protocol) file transfer protocol;

    TFTP (Trivial File Transfer Protocol) is the simplest file transfer protocol;

    X.400 email;

    Telnet work with a remote terminal;

    SMTP (Simple Mail Transfer Protocol) is a simple mail exchange protocol;

    CMIP (Common Management Information Protocol) common information management protocol;

    SLIP ( Serial Line IP) IP for serial lines. Protocol for serial character-by-character data transfer;

    SNMP (Simple Network Management Protocol) simple network management protocol;

    FTAM (File Transfer, Access, and Management) is a protocol for transferring, accessing and managing files.

Presentation layer

The presentation layer or presentation layer represents the data passed between application processes in the desired form of data.

This layer ensures that the information passed by the application layer will be understood by the application layer in another system. In cases of need, the presentation layer at the time of information transfer performs the conversion of data formats into some common presentation format, and at the time of reception, accordingly, performs the reverse conversion. Thus, application layers can overcome, for example, syntactical differences in data representation. This situation can occur in a LAN with heterogeneous computers ( IBM PC andMacintosh) that need to exchange data. So, in the fields of databases, information should be presented in the form of letters and numbers, and often in the form graphic image. You need to process this data, for example, as floating point numbers.

The common data representation is based on the ASN.1 system, which is common for all levels of the model. This system serves to describe the structure of files, and also solves the problem of data encryption. At this level, data encryption and decryption can be performed, thanks to which the secrecy of data exchange is ensured immediately for all application services. An example of such a protocol is the protocol secure Socket layer(SSL) which provides secret messaging for the application layer protocols of the TCP/IP stack. This layer provides data transformation (coding, compression, etc.) of the application layer into an information stream for the transport layer.

The representative layer performs the following main functions:

    Generation of requests to establish interaction sessions between application processes.

    Coordination of data presentation between application processes.

    Implementation of data presentation forms.

    Presentation of graphic material (drawings, drawings, diagrams).

    Data encryption.

    Sending requests to terminate sessions.

Presentation layer protocols are usually integral part protocols of the top three layers of the model.

Session layer

The session layer is the layer that defines the procedure for conducting sessions between users or application processes.

The session layer provides conversation control to capture which party is active in the this moment and also provides synchronization facilities. The latter allow you to insert checkpoints into long transfers so that in case of a failure you can go back to the last one. checkpoint instead of starting all over again. In practice, few applications use the session layer, and it is rarely implemented.

The session layer controls the transfer of information between application processes, coordinates the reception, transmission and issuance of one communication session. In addition, the session layer additionally contains the functions of password management, conversation control, synchronization and cancellation of communication in a transmission session after a failure due to errors in the lower layers. The functions of this level are in communication coordination between two application programs running on different workstations. It comes in the form of a well-structured dialogue. These functions include creating a session, managing the transmission and reception of message packets during a session, and terminating a session.

At the session level, it is determined what the transfer between two application processes will be:

    half duplex(processes will send and receive data in turn);

    duplex(processes will send data and receive them at the same time).

In half-duplex mode, the session layer issues to the process that starts the transmission, data token. When the time comes for the second process to respond, the data token is passed to it. The session layer allows transmission only to the party that possesses the data token.

The session layer provides the following functions:

    Establishment and termination at the session level of a connection between interacting systems.

    Performing normal and urgent communication between application processes.

    Managing the interaction of applied processes.

    Synchronization of session connections.

    Notifying application processes of exceptions.

    Establishing labels in the application process that allow, after a failure or error, to restore its execution from the nearest label.

    Interruption in the necessary cases of the application process and its correct resumption.

    Session termination without data loss.

    Transmission of special messages about the progress of the session.

The session layer is responsible for organizing data exchange sessions between end machines. Session layer protocols are usually a component of the protocols of the top three layers of the model.

Transport Layer.

The transport layer is designed to transfer packets through a communication network. At the transport layer, packets are divided into blocks.

On the way from the sender to the recipient, packets can be corrupted or lost. While some applications have their own error handling, there are some that prefer to deal with a reliable connection right away. The job of the transport layer is to ensure that applications or upper layers of the model (application and session) transfer data with the degree of reliability that they require. The OSI model defines five classes of service provided by the transport layer. These types of services differ in the quality of the services provided: urgency, the ability to restore interrupted communications, the availability of multiplexing facilities for multiple connections between different application protocols through a common transport protocol, and most importantly, the ability to detect and correct transmission errors such as distortion, loss and duplication of packets.

The transport layer determines the addressing of physical devices (systems, their parts) in the network. This layer guarantees the delivery of blocks of information to recipients and manages this delivery. Its main task is to provide efficient, convenient and reliable forms of information transfer between systems. When more than one packet is in processing, the transport layer controls the order in which the packets pass through. If a duplicate of a previously received message passes, then given level recognizes this and ignores the message.

The functions of the transport layer include:

    Network transmission control and ensuring the integrity of data blocks.

    Detection of errors, their partial elimination and reporting of uncorrected errors.

    Transmission recovery after failures and malfunctions.

    Consolidation or division of blocks of data.

    Granting priorities for block transfers (normal or urgent).

    Transfer confirmation.

    Elimination of blocks in deadlock situations in the network.

Starting from the transport layer, all higher protocols are implemented software tools usually included with a network operating system.

The most common transport layer protocols include:

    TCP (Transmission Control Protocol) TCP/IP stack transmission control protocol;

    UDP (User Datagram Protocol) is the user datagram protocol of the TCP/IP stack;

    NCP (NetWare Core Protocol) basic protocol for NetWare networks;

    SPX (Sequenced Packet eXchange) Novell Stack Sequenced Packet Exchange;

    TP4 (Transmission Protocol) - class 4 transmission protocol.

Mancunianthe code refers to self-synchronizing pulse codes and has two levels, which provides good noise immunity. Each cycle (bit interval) is divided into two parts. Information is encoded by potential drops that occur in the middle of each cycle.

A unit is encoded by a high-to-low signal level, and a zero is encoded by a reverse edge. At the beginning of the cycle, a service edge of the signal may occur (when several ones or zeros are transmitted in a row).

Let's consider special cases of coding, as in the previous cases.

At Manchester In coding, the obligatory signal change in the middle of each bit interval makes it easy to isolate the clock signal. That's why Mancunianthe code has good self-synchronizing properties.

The signal does not contain a constant component, the frequency of the fundamental harmonic of the signal is in the range from fo=N/2 Hz to fo=N Hz, varying depending on the type of bit stream.

Manchester coding was used in early versions of 10 Mbps Ethernet technology.

Differential Manchester code (Differential Manchester)

Boolean values ​​"0" and "1" are transferred respectively presence or absence shifts signal level in early clock (bit) interval. In the middle of the bit interval, there is a mandatory change in the signal value.

Differential Manchester encoding

This code has the same advantages and disadvantages as Mancunian.

Of all the codes we have considered, Manchester coding has the best self-synchronization, since the signal edge occurs at least once per clock.

Manchester code is used in Ethernet networks with a transmission rate of 10 Mbps (10Base-T). Differential Manchester code - in networks with Token Ring technology.

Currently, the developers have come to the conclusion that in many cases it is more rational to apply potential coding, eliminating its shortcomings with the help of the so-called logical coding (cm. below in this section).

Return to zero code rz (Return to Zero)

Bit "1" - impulse one polarity in the first half of the bit interval, in the second half of the bit interval the signal has zero potential.

Bit "0" - impulse another polarity in the first half of the bit interval, in the second half of the bit interval the signal has zero potential. The code has good synchronization properties.

For this code, the bit interval
.

Code with inversion of code values ​​cmi.

With this transmission method, bit 1 is represented according to the rules quasi-ternary coding, and bit 0 - in the form of two pulses of opposite polarity with a sign change in the middle. The code also has good synchronization properties.

Potential code 2b1q

This is a potential code with four signal levels to encode data. The name reflects the essence of encoding - every two bits (2B) are transmitted in one cycle by a signal of a certain level (1Q) . The line signal has four states. In other words, the information rate N in this coding method is twice the modulation rate B.

2B1Q encoding

Signal in 2B1Q code

The figure shows a signal corresponding to the bit sequence: 01 01 10 00. The main frequency of the signal in the 2B1Q code does not exceed the value fo=N/4 Hz.

However, to implement this coding method, the transmitter power must be higher so that the four potential values ​​are clearly distinguished by the receiver against the noise background.

The code MLT3 (Multi Level Transmission - 3) .

Three transmission levels are used: "-1", "0", "+1".

Unity corresponds required transition from one signal level to another at the edge of the clock interval.

zero corresponds absence line signal level changes.

When transmitting a sequence of ones, the signal level change period includes four bits. In this case fo=N/4 Hz. This is the maximum fundamental frequency of the signal in the code. MLT-3. In the case of an alternating sequence of zeros and ones, the fundamental harmonic of the signal is at a frequency fo=N/8 Hz, which is half that of the code NRZI.

Signal in MLT-3 code

Logic coding

Logic coding carried out by the transmitter until physicalcoding, discussed above, by means of the link or physical layer. At the stage logicalcoding struggle with the shortcomings of the methods physicaldigitalcoding - absencesynchronization, Availabilityconstantcomponent. Thus, first with the help of logicalcoding corrected bit sequences are formed, which are then using simple methodsphysicalcoding transmitted over communication lines.

Booleancoding involves replacing the bits of the original information sequence with a new bit sequence that carries the same information, but has, in addition, additional properties, such as the ability for the receiving side to detect errors in the received data or to reliably maintain synchronization with the incoming signal.

Distinguish two methods of logical coding:

- coding redundant code;

- scrambling.

Excess codes (table codes) are based on splitting the original bit sequence into groups and then replacing each original group with a code word in accordance with the table. A codeword always contains more bits than the original group.

Logic code 4V/5V replaces the original 4-bit groups with 5-bit codewords. As a result, the total number of possible bit combinations for them (2 5 =32) is greater than for the original groups (2 4 =16). Therefore, in code table you can include 16 such combinations that do not contain more than two zeros in a row, and use them to transfer data. The code guarantees that no more than three zeros in a row can occur on the line for any combination of code words.

The remaining code combinations are used to transmit service signals (transmission synchronization, start of data block, end of data block, transmission control at the link layer). Unused codewords may be used by the receiver to detect errors in the data stream. The price for the advantages obtained with this method of data encoding is a decrease in the transmission rate of useful information by 25%.

Line code

Symbol

Source group

4V/5V logical coding is used in 100Mbit/s Ethernet networks:

    in combination with NRZI code (100Base FX specification, transmission medium - optical fiber);

    combined with MLT-3 code (100Base TX specification, UTP Cat 5e transmission medium).

There are also codes with three signal states, for example, in the code 8V/6T to encode 8 bits of the original information, code words of the ternary code of 6 elements are used. Each element can take one of three values ​​(+1, 0, -1). Code Redundancy 8V/6T higher than code 4V/5V, since on 2 8 = 256 source characters accounted for 3 6 =729 resulting code words. This encoding method is used in the 100Base T4 specification - when organizing 100Mbps Ethernet over UTP Cat3 cable (obsolete specification). Here, 3 twisted pairs are used simultaneously to transmit the bit stream. The information transfer rate for each pair is N=100 Mbps / 3 = 33.3 Mbps, the modulation rate of the linear signal is 25 M Baud (8:6=1.33; 33.3:1.33=25) , which allows the use of unshielded twisted pair UTP Cat3.

In code8V/10V every 8 bits of the original sequence are replaced by ten bits of the code word. At the same time, there are 1024 resulting combinations for 256 initial combinations. When replacing in accordance with the code table, the following rules are observed:

      no resulting combination (code word) should have more than 4 identical bits in a row;

      no resulting combination should contain more than 6 zeros or 6 ones;

The 8B/10B(+NRZI) code is used in the 1000Base-X Gigabit Ethernet standard (when fiber is used as the transmission medium).

Implement logical coding network adapters. Since the use of a lookup table is a very simple operation, the logical redundancy encoding method does not complicate the functional requirements of this equipment.

To ensure a given throughputNA bit/s transmitter using a redundant code must operate at an increased clock rate. So, for signal transmission in code 4V/5V with information transfer rate N= 100 Mbps, the transmitter must operate at a clock frequency 125 MHz (i.e.B=125 MBaud). In this case, the spectrum of the linear signal is expanded. However, the signal spectrum of the redundant potential code turns out to be narrower than the signal spectrum in Manchestercode, which justifies the additional step of logical coding, as well as the operation of the receiver and transmitter at an increased clock frequency.

Scrambling is such a "mixing" of the original bit sequence, in which the probability of occurrence of ones and zeros at the input of the physical encoding module becomes close to 0.5. Devices (or software modules) that perform this operation are called scramblers (scramble - dump, random assembly).

Scheme for including a scrambler in a communication channel

The scrambler in the transmitter performs the transformation of the structure of the original digital stream. The descrambler in the receiver restores the original bit sequence. Almost the only operation used in scramblers and descramblers is XOR - "bitwise XOR"(addition by module 2).

The main part of the scrambler and descrambler is a pseudo-random sequence generator (PRS) in the form of a K-bit feedback shift register.

There are 2 main types of pairs of scramblers - descramblers:

    self-synchronizing;

    with initial installation (additive).

Self-clocking circuits are controlled by a scrambled sequence. These schemes have the disadvantage of error propagation. The influence of the erroneous symbol appears as many times as feedback is in the schema.

A variant of the implementation of scrambling in a self-synchronizing scheme.

Let, for example, the scrambler implements the relation In i =A i +B i -5 +B i -7 .

Here Bi is the binary digit of the resulting code obtained on the i-th cycle of the scrambler; Ai is a binary digit of the source code that arrives in the transmitter at the input of the scrambler on the i-th cycle; B i -5 and B i -7 are the binary digits of the resulting code obtained in the previous cycles of the scrambler, respectively, on "i-5" and "i-7" cycles.

The descrambler in the receiver reconstructs the original sequence using the relation

C i =B i +B i-5 +B i-7 =(A i +B i-5 +B i-7)+B i-5 +B i-7 =A i

In additive circuits, the scrambled sequence is not fed to the input of the shift registers, there is no error propagation, but synchronization of the operation of the scrambler-descrambler pair is required.