Ethernet communication and physical layer working principle

Illustration of communication principles (Ethernet communication and physical layer working principle)

89 people liked this article
Table of contents
close
Overview
1. What is Ethernet digital communication?
1. Standard Ethernet
2. Fast Ethernet
3. Gigabit Ethernet
4. 10Gbps Ethernet
5. 40G/100Gbps Ethernet
2. Requirements structure of Ethernet digital communication case
3. Software and hardware implementation of Ethernet digital communication
1. Protocol stack
2. Software and hardware architecture and software and hardware division of labor
3. Ethernet protocol specifications
4. Communication model of Ethernet MAC+PHY+line layer
5. The process of information transmission by the source and its key principles
1. Source:
2. Discrete binary data
3. Network layer coding
4. Physical layer encoding
6. Channel-to-information transmission process
7. Information reception process and key principles of Xinsu
1. Ethernet decoding process
2. Information receiving process

Overview

Ethernet is a computer local area network communication technology, which mainly consists of the media access layer (MAC L2) protocol, physical layer (PHY L1) protocol, and electronic signal connections.

The MAC layer is mainly implemented by the switching chip, the physical layer is implemented by the PHY chip, and the electrical signal connection mainly defines the interface specification of the electrical signal.

This article takes the technical implementation of mature Ethernet as an example to interpret some basic principles of digital communication and clarify some core concepts in digital communication: clock, 4B/5B encoding, Manchester encoding, NRZI encoding, symbols, baud rate , bit rate, CRC, scrambling code.

And focus on the protocol specifications of the Ethernet physical layer.


Signal sending and receiving process

Source information transmission-》Discrete data-》Source coding-》Application layer data processing-》Network layer coding-》Physical layer channel coding-》Electrical signal symbol coding-》Electrical signal transmission=》

Electrical signal reception =》Electrical signal symbol decoding-》Physical layer channel decoding-》Network layer coding-》Application layer data processing-》Source decoding-》Sink information perception

The entire process is binary discrete data processing, so this article is a case of pure digital communication.


There are two significant differences between Ethernet serial communication and Uart serial communication, I2C serial communication, SPI serial communication and other serial communications:

(1) There is no longer a 1-to-1 mapping relationship between the binary data in the physical layer frame that needs to be transmitted and the signal level transmitted on the physical line.

(2) There is no need for a special clock signal line to transmit clocks between two communicating nodes. Instead, specific physical layer encoding technology is used to transmit data while also transmitting synchronous clocks.

(3) Digital encoding technology that supports remote transmission

This article will focus on these three technical methods.

———————————————————————————————————————

1. What is Ethernet digital communication?

Ethernet is a baseband, local area network technology.

Ethernet communication is a communication method that uses coaxial cables or optical fibers as transmission channels and adopts carrier multiple access and conflict detection mechanisms.

The data transmission rate is as high as 10M, 100M, 1Gbit/s, 10Gbit/s, 25Gbit/s, 100G, which can meet the needs of non-continuous network data transmission.

<img src="https://pic2.zhimg.com/v2-b222749c0799a341b13c69e271257359_b.jpg" data-caption="" data-size="normal" data-rawwidth="500" data-rawheight="515" class="origin_image zh-lightbox-thumb" width="500" data-original="https://pic2.zhimg.com/v2-b222749c0799a341b13c69e271257359_r.jpg"/>

1. Standard Ethernet

  • 10Base-5 uses thick coaxial cable, the maximum network segment length is 500m, and the baseband transmission method;
  • 10Base-2 uses thin coaxial cable, the maximum network segment length is 185m, and the baseband transmission method;
  • 10Base-T uses twisted pair cables, and the maximum network segment length is 100m;
  • 1Base-5 uses twisted pair cables, the maximum network segment length is 500m, and the transmission speed is 1Mbps;
  • 10Broad-36 uses coaxial cable (RG-59/U CATV), the maximum segment length is 3600m, and is a broadband transmission method;
  • 10Base-F uses optical fiber transmission media with a transmission rate of 10Mbps;

2. Fast Ethernet

  • 100Base-TX physical medium uses Category 5 or above twisted pairs, and the network segment length is up to 100 meters.
  • 100Base-FX uses single-mode optical fiber as the physical medium, and the network segment length can reach 10 kilometers.

3. Gigabit Ethernet

  • 1000Base-SX only supports multi-mode optical fiber . It can use multi-mode optical fiber with a diameter of 62.5um or 50um. The operating wavelength is 770-860nm and the transmission distance is 220-550m.
  • 1000Base-LX can use multi-mode optical fiber with a diameter of 62.5um or 50um, the operating wavelength range is 1270-1355nm, and the transmission distance is 550m.
  • 1000Base-LX can support single-mode optical fiber with a diameter of 9um or 10um, the operating wavelength range is 1270-1355nm, and the transmission distance is about 5km.
  • 1000Base-CX uses 150 ohm shielded twisted pair (STP), and the transmission distance is 25m.
  • 000Base-T is a natural extension of 100Base-T and is fully compatible with 10Base-T and 100Base-T.

4. 10Gbps Ethernet

  • 10GBASE-CX4 -- Short-reach copper solution for InfiniBand 4x connectors and CX4 cables, with a maximum length of 15 meters.
  • 10GBASE-SR -- for short-distance multimode fiber, up to 26-82 meters depending on cable type, up to 300 meters using new 2GHz multimode fiber.
  • 10GBASE-LX4 -- Uses wavelength division multiplexing to support 240-300 meters of multi-mode fiber and more than 10 kilometers of single-mode fiber.
  • 10GBASE-LR and 10GBASE-ER -- support 10km and 40km respectively over single-mode fiber
  • 10GBASE-SW, 10GBASE-LW, 10GBASE-EW. For WAN PHY, OC-192/STM-64 synchronized optical network / SDH equipment. The physical layer corresponds to 10GBASE-SR, 10GBASE-LR and 10GBASE-ER respectively, so the same optical fiber is used to support the same distance. (No WAN PHY standard)
  • 10GBASE-T -- Use shielded or unshielded twisted pair cable, and use CAT-6A cable to support transmission of at least 100 meters. CAT-6 cable also supports 10GBASE-T over shorter distances.

5. 40G/100Gbps Ethernet

  • 40GBASE-KR4 -- backplane solution, minimum distance 1 meter.
  • 40GBASE-CR4 / 100GBASE-CR10 -- short-distance copper cable solution, the maximum length is about 7 meters.
  • 40GBASE-SR4 / 100GBASE-SR10 -- used for short-distance multimode optical fiber, with a length of at least 100 meters.
  • 40GBASE-LR4 / 100GBASE-LR10 -- Using single-mode fiber, distances over 10 kilometers.
  • 100GBASE-ER4 -- Using single-mode fiber, distances over 40 kilometers.

Although Ethernet supports the above-mentioned various speeds and physical layer interface specifications, from a communication perspective, the basic principles are similar and are of the same origin.

2. Requirements structure of Ethernet digital communication case

In order to focus on the Ethernet physical layer protocol, this article uses two peer-to-peer Ethernet terminals, skipping the intermediate Ethernet switch and directly using point-to-point connection.

<img src="https://pic2.zhimg.com/v2-c88284f9ce8247617326962bd2a0d14d_b.jpg" data-caption="" data-size="normal" data-rawwidth="578" data-rawheight="323" class="origin_image zh-lightbox-thumb" width="578" data-original="https://pic2.zhimg.com/v2-c88284f9ce8247617326962bd2a0d14d_r.jpg"/>

Handsome guy A and beautiful girl B are no longer connected through the RS232 serial port, but through Ethernet.

Target:

Handsome guy A sends a binary message to beauty B through Ethernet: 0x0049 0x0020 0x004c 0x0006f 0x00076 0x0065 0x0020 0x0059 0x006f 0x0075.

The corresponding ASCII code character is: I Love You

3. Software and hardware implementation of Ethernet digital communication

1. Protocol stack

<img src="https://pic3.zhimg.com/v2-685d181abf237c583a549f4835b1a5a2_b.jpg" data-caption="" data-size="normal" data-rawwidth="578" data-rawheight="580" class="origin_image zh-lightbox-thumb" width="578" data-original="https://pic3.zhimg.com/v2-685d181abf237c583a549f4835b1a5a2_r.jpg"/>

2. Software and hardware architecture and software and hardware division of labor

<img src="https://pic2.zhimg.com/v2-83d8b7d3894fdc939d607b844ada28d1_b.jpg" data-caption="" data-size="normal" data-rawwidth="603" data-rawheight="853" class="origin_image zh-lightbox-thumb" width="603" data-original="https://pic2.zhimg.com/v2-83d8b7d3894fdc939d607b844ada28d1_r.jpg"/>

The encapsulation (encoding) process of the data sent by handsome guy A is as follows:

Application layer data encoding=》HTTP layer data encoding=》TCP layer data encoding=》IP layer data encoding=》MAC layer data encoding=》Physical layer data encoding=》Physical layer electrical signal transmission=》

The process of unpacking (decoding) the data accepted by the beauty is as follows:

Physical layer electrical signal reception=》Physical layer data decoding=》MAC layer data decoding=》IP layer data decoding=》TCP layer data decoding=》HTTP layer data decoding=》Application layer data decoding.

As for the encoding and decoding process above the MAC layer (IP and above IP), it is beyond the scope of this article.

This article focuses on the MAC+PHY+line interface layer, especially the encoding and decoding process of the physical layer.

3. Ethernet protocol specifications

The IEEE802.3 standard provides protocol specifications for the MAC layer and physical layer of Ethernet

<img src="https://pic2.zhimg.com/v2-107e3ee4bc123e65e36696b903c35325_b.jpg" data-caption="" data-size="normal" data-rawwidth="599" data-rawheight="450" class="origin_image zh-lightbox-thumb" width="599" data-original="https://pic2.zhimg.com/v2-107e3ee4bc123e65e36696b903c35325_r.jpg"/>

4. Communication model of Ethernet MAC+PHY+line layer

<img src="https://pic1.zhimg.com/v2-df713300fdd48cd1d2c8b6e4e28ac4d4_b.jpg" data-caption="" data-size="normal" data-rawwidth="786" data-rawheight="555" class="origin_image zh-lightbox-thumb" width="786" data-original="https://pic1.zhimg.com/v2-df713300fdd48cd1d2c8b6e4e28ac4d4_r.jpg"/>

Below, each link of the above process will be introduced in detail, as well as the key technologies in the communication principles involved in each link.

5. The process of information transmission by the source and its key principles

1. Source:

The source here is computer A.

2. Discrete binary data

The source needs to send discrete binary data: 0x0049 0x0020 0x004c 0x0006f 0x00076 0x0065 0x0020 0x0059 0x006f 0x0075.

The corresponding ASCII code character is: I Love You

3. Network layer coding

IP and above IP are beyond the scope of this chapter. This chapter discusses MAC and the protocols below the MAC layer.

(1) Concept clarification before discussion:

MAC layer: called frame

Physical layer: parallel data is called a package

Physical layer: Serial data is called a stream

(2) MAC layer frame structure

<img src="https://pic3.zhimg.com/v2-bd0b9acab2e23616da80763da1174a1a_b.jpg" data-caption="" data-size="normal" data-rawwidth="585" data-rawheight="140" class="origin_image zh-lightbox-thumb" width="585" data-original="https://pic3.zhimg.com/v2-bd0b9acab2e23616da80763da1174a1a_r.jpg"/>

LLC data: Discrete binary data that the source needs to send.

MAC address : Also called physical address and hardware address, it is burned into the EPROM (a flash memory chip that can usually be erased by a program) on the network interface card when it is produced by the network equipment manufacturer .

The length of a MAC address is 48 bits (6 bytes), usually expressed as 12 hexadecimal numbers. For example: 00-16-EA-AE-3C-40 is a MAC address, of which the first 6 hexadecimal digits are 00-16-EA represents the number of the network hardware manufacturer, which is assigned by IEEE (Institute of Electrical and Electronics Engineers), and the next 6-digit hexadecimal number AE-3C-40 represents a certain network product manufactured by the manufacturer (such as network card) serial number. As long as your MAC address is not changed, the MAC address is unique in the world. Figuratively speaking, the MAC address is like the ID number on the ID card, which is unique.

Destination address: The MAC address of the recipient (sink) of the data.

Source address: The MAC address of the sender (source) of the data.

Frame delimiter SFD: 1 byte (8 bits: 0x1010 1011), MAC layer frame synchronization.

Since the lowest bit (LSB) is transmitted first when transmitting a byte, its corresponding hexadecimal representation is: 0xD5. There is a similar problem here. What should I do if the payload of the Ethernet frame happens to contain this data?

Synchronous preamble: 7 bytes (56 bits: 0x1010 1010...), MAC layer bit clock synchronization.

Since the lowest bit is transmitted first (LSB) when transmitting a byte, its corresponding hexadecimal representation is: 0x55 0x55 0x55 0x55 0x55 0x55 0x55. This continuous stream of 56 binary bits is used for the receiver and sender. Binary bit clock synchronization.

There is a question here. What should I do if the payload of the Ethernet frame coincidentally contains this data?

Solution :

The start of the Ethernet frame is transmitted between the MAC layer and the physical layer through Tx_EN and Rx_EN.

Between two peer physical layer entities, the 4B/5B encoding of the physical layer indicates the start and end of the Ethernet frame, and these two encodings are different from the 4B/5B encoding of any data in the data domain. .

FCS (Frame Check Sequence): Frame check sequence, which is actually a CRC check.

The addition of the CRC check sequence is

During the data transmission process, no matter how perfect the transmission system is designed, errors will always exist. This error may cause one or more frames transmitted on the link to be destroyed (bit errors occur, 0 becomes 1, or 1 becomes 0), so the recipient receives incorrect data. In order to maximize the accuracy of the data received by the receiver, the data needs to be error-detected before the receiver receives the data. The receiver will actually accept the data if and only if the detection result is correct.

There are many detection methods, common ones include parity check , cyclic redundancy check, etc.

As discussed in the previous article, Uart/RS232 serial communication uses parity check.

Cyclic Redundancy Check (CRC): It is a channel coding technology that generates a short fixed-digit check code based on network data packets or computer files. It is mainly used to detect or verify data transmission or Possible errors after saving. It uses the principles of division and remainder for error detection.

Ethernet communication uses CRC32 as the error detection code of the Ethernet MAC frame data payload.

Note: The FCS value refers to the payload part of the Ethernet MAC frame, including the MAC address + data payload, excluding the synchronization word and frame delimiter SFD of the Ethernet MAC layer frame.

4. Physical layer encoding

Simply put, physical layer encoding ensures that the original MAC layer data can be transmitted safely and reliably on a variety of physical media.

(1) The Ethernet physical layer is divided into 3 sub-layers and 2 interfaces

<img src="https://pic3.zhimg.com/v2-15bec7a002d5957b46001f59ba54fe56_b.jpg" data-caption="" data-size="normal" data-rawwidth="248" data-rawheight="204" class="content_image" width="248"/>

(2) Two interfaces:

Medium Independent Interface (MII): Medium Independent Interface. Provide a public interface and shield different details of multiple physical layers. This is the interface between the digital MAC layer and the digital physical layer.

Medium Dependent Interface (MDI): Medium Dependent Interface. The interface to the transmission medium , such as 100M electrical port, 1000M electrical port or 1000M optical port, etc. This is the interface between the digital physical layer and the physical signal media (optical, electrical signals).

(3) Three sub-layers:

Physical Coding Sublayer (PCS): Physical coding sublayer. Complete physical layer encoding/decoding function

Physical Medium Attachment sublayer (PMA): Physical Medium Attachment sublayer. Perform parallel-to-serial conversion and serial-to-parallel conversion functions.

Physical Medium Dependent sublayer (PMD): Physical Medium Dependent sublayer. Convert electrical signals to specific media or vice versa (photoelectric conversion, electro-electric conversion)

<img src="https://pic1.zhimg.com/v2-0192c2c5389bd3dfd5f4688426420c70_b.jpg" data-caption="" data-size="normal" data-rawwidth="400" data-rawheight="197" class="content_image" width="400"/>

Different Ethernet rates have different physical layer protocol specifications.

Chips from different manufacturers also have differences in implementing the Ethernet physical layer protocol specifications.

Next, we will take the ancient RTL8201 10/100M PHY chip as an example to introduce the communication principles of the physical layer from simple to complex:

  • RTL8201 10M Ethernet communication principle
  • RTL8201 100M Ethernet communication principle

The implementation of other more complex functions is basically an upgrade and expansion based on this principle.

(4) 802.3 physical layer function stack

<img src="https://pic1.zhimg.com/v2-c73885127813a8be279fe6f62427dfec_b.jpg" data-caption="" data-size="normal" data-rawwidth="475" data-rawheight="605" class="origin_image zh-lightbox-thumb" width="475" data-original="https://pic1.zhimg.com/v2-c73885127813a8be279fe6f62427dfec_r.jpg"/>

(5) RTL8201 functional architecture

<img src="https://pic3.zhimg.com/v2-54c628ed33b773ac3d6ddfd24a3cf71e_b.jpg" data-caption="" data-size="normal" data-rawwidth="804" data-rawheight="360" class="origin_image zh-lightbox-thumb" width="804" data-original="https://pic3.zhimg.com/v2-54c628ed33b773ac3d6ddfd24a3cf71e_r.jpg"/>
<img src="https://pic1.zhimg.com/v2-3ca7aefe86db8854d6cc1ec3f90ecbf8_b.jpg" data-caption="" data-size="normal" data-rawwidth="642" data-rawheight="726" class="origin_image zh-lightbox-thumb" width="642" data-original="https://pic1.zhimg.com/v2-3ca7aefe86db8854d6cc1ec3f90ecbf8_r.jpg"/>
<img src="https://pic3.zhimg.com/v2-53486b15ca2c28bf6f913f7ec8cb2a5a_b.jpg" data-caption="" data-size="normal" data-rawwidth="670" data-rawheight="460" class="origin_image zh-lightbox-thumb" width="670" data-original="https://pic3.zhimg.com/v2-53486b15ca2c28bf6f913f7ec8cb2a5a_r.jpg"/>

In the figure above, the functional implementations of 10M and 100M are completely different circuits.

The green box marks the function implementation of 10M.

The red box marks the function implementation of 100M

Next, its functions will be explained in detail.

4.1 Communication principle of RTL8201 10M Ethernet

4.1.1 PCS sublayer (Physical Coding Sublayer): physical layer coding sublayer

The function of the PCS sublayer is the encoding/decoding of the physical layer. Includes three parts:

(1) Interface with MAC layer

(2) Structure of physical layer package

(3) Coding of physical layer

Physical interface between PCS sublayer and MAC layer

<img src="https://pic4.zhimg.com/v2-e0869ebafe4d64c99efddadc14537fef_b.jpg" data-caption="" data-size="normal" data-rawwidth="794" data-rawheight="384" class="origin_image zh-lightbox-thumb" width="794" data-original="https://pic4.zhimg.com/v2-e0869ebafe4d64c99efddadc14537fef_r.jpg"/>

TXD0, RXD0: They are serial data interfaces. At 10M rate, the physical layer chip does not need to perform serial-to-parallel conversion. The serial-to-parallel conversion is completed by the MAC.

TXC and RXC: receive and transmit clock.

COL (I): Input for collision detection, indicating that the MAC layer has detected a conflict.

CRS (O): Carrier detection, used by the PHY to indicate to the MAC whether data is being sent on the link.

TXEN: MAC sends data indication.

Packet structure of PCS sublayer

At 10M rate, the structure of the physical layer packet is consistent with the frame structure of the MAC layer.

<img src="https://pic3.zhimg.com/v2-bd0b9acab2e23616da80763da1174a1a_b.jpg" data-caption="" data-size="normal" data-rawwidth="585" data-rawheight="140" class="origin_image zh-lightbox-thumb" width="585" data-original="https://pic3.zhimg.com/v2-bd0b9acab2e23616da80763da1174a1a_r.jpg"/>

Coding of PCS sub-layer

An important function of physical layer encoding is to encode the original physical layer frame data into binary data suitable for physical line transmission.

In the case of 10M communication, the physical layer chip does not perform some physical layer encoding on the physical layer, such as 4B/5B encoding or 8B/10B encoding.

4.1.2 PMA sublayer: physical medium connection sublayer

PMA functions include

(1) The sending direction is parallel-to-serial conversion, and the receiving direction is serial-to-parallel conversion.

(2) Physical layer signal coding

(3) Synthesis/recovery of physical link clock.

The PMA receives the serial bit stream from the PCS and then sends it to the PMD layer.

PMA uses a digital phase-locked loop (PLL) to send a bit stream according to a standard clock interface at the transmitting end. The PLL at the receiving end synchronizes the serial data stream and extracts the clock from it.

The sending direction is parallel-to-serial conversion, and the receiving direction is serial-to-parallel conversion.

At the 10M rate, there is no parallel-to-serial conversion, and the interface MAC itself with the MAC layer is serial data.

physical layer signal encoding

Physical layer signal encoding: that is, how to transmit the binary data stream of 0 and 1 through the electrical signal of the physical layer.

There are two common categories of coding: non-return-to-zero codes and return-to-zero codes.

Non-return to zero code: It is a coding method in which the signal level does not return to zero within one symbol. In the non-return-to-zero code, high level represents 1, and 0 level itself represents 0, so it cannot be returned to 0.

Return-to-zero code: It is a coding method in which the signal level returns to zero within one symbol. In the return-to-zero code, high level and low level do not represent any numerical value, but use the rising or falling edge of the signal to represent 0 or 1, so it can be returned to zero.

In SPI and I2C communications, 1s and 0s are transmitted through CMOS or TTL high and low levels. High level represents 1, low level represents 0,

In UART communication, same as SPI and I2C.

In RS232 communication, inverse logic and 15V voltage are used. +15V electrical signal represents 0, -15V electrical signal represents 1.

These encoding methods are called non-return-to-zero codes .

Among them, the encoding method of SPI, I2C, and Uart serial communication is called: unipolar non-return-to-zero 0 code, and unipolar means only positive (+) level.

The encoding method of RS232 serial communication is called bipolar non-returning to 0 code. Bipolar refers to positive (+) levels and negative (-) levels.

As shown in the figure below: (a) is a unipolar non-return to zero code, (b) a bipolar non-return to zero code.

<img src="https://pic2.zhimg.com/v2-cf3cd0ce228cfb5f27321daacea8be45_b.jpg" data-caption="" data-size="normal" data-rawwidth="802" data-rawheight="546" class="origin_image zh-lightbox-thumb" width="802" data-original="https://pic2.zhimg.com/v2-cf3cd0ce228cfb5f27321daacea8be45_r.jpg"/>

Compared with the several electrical signal encoding methods mentioned earlier, in 10M Ethernet, a new physical layer signal encoding method is adopted : Manchester encoding!

Manchester coding (Manchester) is also called split phase code, synchronization code, and phase coding. It is a return-to-zero coding method that uses level jumps to represent 1 or 0.

The changing rules are simple:

There are also two types of code elements here, but each code element does not use a simple high level or low level. Each code element symbol ( an electrical signal representing 0 or 1 ) uses two level signals (high level) with different phases. level + low level).

In fact, each symbol is a complete square wave signal (with high level and low level). There are two ways to define a square wave signal.

(A) GE Thomas Manchester encoding (also known as standard Manchester encoding)

<img src="https://pic1.zhimg.com/v2-7e9b657b96419175d8dda9b71a062d1c_b.jpg" data-caption="" data-size="normal" data-rawwidth="473" data-rawheight="265" class="origin_image zh-lightbox-thumb" width="473" data-original="https://pic1.zhimg.com/v2-7e9b657b96419175d8dda9b71a062d1c_r.jpg"/>

A square wave with a phase of 0 degrees (similar to a sine wave) represents "1",

A square wave with phase 180 (similar to a cosine wave) represents "0".

(B) 802.3 Manchester encoding (referred to as Manchester encoding)

<img src="https://pic1.zhimg.com/v2-8974aaf16e60a90b2552273085cc14b8_b.jpg" data-caption="" data-size="normal" data-rawwidth="473" data-rawheight="246" class="origin_image zh-lightbox-thumb" width="473" data-original="https://pic1.zhimg.com/v2-8974aaf16e60a90b2552273085cc14b8_r.jpg"/>

A square wave with a phase of 0 degrees (similar to a sine wave) represents "0",

A square wave with phase 180 (similar to a cosine wave) represents "1".

Just the opposite of standard Manchester encoding.


The following is a schematic diagram of a series of binary codes 1010 0111 001 represented by two different Manchester encodings:

<img src="https://pic2.zhimg.com/v2-add11cd85a5a2b17e22192a515736791_b.jpg" data-caption="" data-size="normal" data-rawwidth="683" data-rawheight="300" class="origin_image zh-lightbox-thumb" width="683" data-original="https://pic2.zhimg.com/v2-add11cd85a5a2b17e22192a515736791_r.jpg"/>

It can be seen from the diagram above:

In both Manchester encodings, there is a transition in the middle of each bit. The difference is that rising and falling edges represent exactly the opposite numbers.

The middle transition is used to represent the binary data to be transmitted, and at the same time, the middle transition can be used as a clock signal.

(C) Differential Manchester encoding

There is also a differential Manchester encoding, which is an improvement of Manchester encoding.

In differential Manchester coding, there is also a transition in the middle of each bit.

But the transition in the middle does not represent the binary data to be transmitted, the transition in the middle is only used as a clock signal.

The special thing about differential Manchester encoding is that it does not use a fixed waveform to identify 0 or 1, but uses the change of two adjacent waveform symbols to identify 0 or 1.

Regardless of whether the previous waveform symbol is "sine-like square wave" or "cosine-like square wave",

If the latter tilde symbol is the same as the previous tilde symbol, it means 0, as shown in the figure below, so the tilde symbol identifying "0" is not unique.

<img src="https://pic4.zhimg.com/v2-3cfa9562fbcc288538a77e84136db257_b.jpg" data-caption="" data-size="normal" data-rawwidth="292" data-rawheight="173" class="content_image" width="292"/>

If the next tilde symbol (symbol) is different from the previous tilde symbol (symbol), it means 1, as shown in the figure below, so the tilde symbol (symbol) identifying "1" is not unique.

<img src="https://pic2.zhimg.com/v2-4e8e1bf3870a25d7de2a02742abcd309_b.jpg" data-caption="" data-size="normal" data-rawwidth="279" data-rawheight="175" class="content_image" width="279"/>

This encoding method avoids the problem of Thomas Manchester encoding and 802.3 Manchester encoding using fixed waveforms to identify 0 or 1.

The following is a comparison of three Manchester encodings:

<img src="https://pic2.zhimg.com/v2-fe078073a0659d300a9da1ca909fe215_b.jpg" data-caption="" data-size="normal" data-rawwidth="773" data-rawheight="500" class="origin_image zh-lightbox-thumb" width="773" data-original="https://pic2.zhimg.com/v2-fe078073a0659d300a9da1ca909fe215_r.jpg"/>

In the above three Manchester encoding methods, each clock bit must change once , so the efficiency of these three encodings can only reach about 50% . This is the shortcoming of Manchester encoding.

in conclusion:

According to whether it is data 0 or data 1, it is carried by a complete cycle of sine or cosine signal (of course, it can also be said to be a square wave).


Physical link clock synthesis/recovery.

As described above, at the sending end, driven by the clock, the Manchester encoded data itself contains the clock frequency of the sending end .

<img src="https://pic4.zhimg.com/v2-369ac14d4c1f8183fb0ea55693f0626b_b.jpg" data-caption="" data-size="normal" data-rawwidth="300" data-rawheight="218" class="content_image" width="300"/>

As can be seen from the figure above, the clock signal is a square wave signal. During the data level of 0 or 1, it contains a complete clock square wave signal. A square wave signal is a high level and a low level. combination.

The period of the clock signal is exactly the same as the period of the sinusoidal and cosine-like square wave signals carrying data 0 or data 1, that is, the frequency is the same.

Through Manchester coding, the sending and receiving ends of communication do not need special clock signal lines to transmit clock information.

<img src="https://pic2.zhimg.com/v2-0e1abc78a812bdb72d208334da5ef6ad_b.jpg" data-caption="" data-size="normal" data-rawwidth="432" data-rawheight="251" class="origin_image zh-lightbox-thumb" width="432" data-original="https://pic2.zhimg.com/v2-0e1abc78a812bdb72d208334da5ef6ad_r.jpg"/>

The receiving end uses a digital phase-locked loop to recover the frequency and phase of the clock signal used by the sending end to send binary bits from the link, and can be completely synchronized.

At this point, under the communication method of 10M data rate, binary bits can be sent through physical signals.

<img src="https://pic3.zhimg.com/v2-53486b15ca2c28bf6f913f7ec8cb2a5a_b.jpg" data-caption="" data-size="normal" data-rawwidth="670" data-rawheight="460" class="origin_image zh-lightbox-thumb" width="670" data-original="https://pic3.zhimg.com/v2-53486b15ca2c28bf6f913f7ec8cb2a5a_r.jpg"/>


(2) Principle of RTL8201 100M Ethernet communication

1) PCS sublayer (Physical Coding Sublayer): physical layer coding sublayer

The function of the PCS sublayer is the encoding/decoding of the physical layer. Includes three parts:

  • Interface between PCS sublayer and MAC layer
  • Packet structure of PCS sublayer
  • Coding of PCS sub-layer

(1). Physical interface with MAC layer

<img src="https://pic4.zhimg.com/v2-c9f41a78065b18aa002b80c157282bef_b.jpg" data-caption="" data-size="normal" data-rawwidth="619" data-rawheight="540" class="origin_image zh-lightbox-thumb" width="619" data-original="https://pic4.zhimg.com/v2-c9f41a78065b18aa002b80c157282bef_r.jpg"/>

From the above figure, it can be seen that the MII interface, between the physical layer and the MAC layer, is 4-bit parallel data , not serial data.

The reason why it is 4-bit parallel data has a lot to do with the 4B/5B encoding introduced next.

(2) Sending of physical layer frames

<img src="https://pic2.zhimg.com/v2-3beff14d2b8ae43c54891fe89fcaa851_b.jpg" data-caption="" data-size="normal" data-rawwidth="686" data-rawheight="348" class="origin_image zh-lightbox-thumb" width="686" data-original="https://pic2.zhimg.com/v2-3beff14d2b8ae43c54891fe89fcaa851_r.jpg"/>

Tx_En: Start sending MAC frames.

TXD<3:0>: MAC layer frame, including preamble, frame synchronization code, data payload and CRC.

<img src="https://pic1.zhimg.com/v2-259b31b6b6341d7c1164dacdfb5a13b0_b.jpg" data-caption="" data-size="normal" data-rawwidth="669" data-rawheight="312" class="origin_image zh-lightbox-thumb" width="669" data-original="https://pic1.zhimg.com/v2-259b31b6b6341d7c1164dacdfb5a13b0_r.jpg"/>

(3) Reception of physical layer frames

<img src="https://pic2.zhimg.com/v2-3ba5bc94bbce9e2616aee72ce391f0b9_b.jpg" data-caption="" data-size="normal" data-rawwidth="648" data-rawheight="270" class="origin_image zh-lightbox-thumb" width="648" data-original="https://pic2.zhimg.com/v2-3ba5bc94bbce9e2616aee72ce391f0b9_r.jpg"/>

RX_DV: valid data starts

RXD<3:0>: MAC layer frame, including preamble, frame synchronization code, data payload and CRC.

<img src="https://pic4.zhimg.com/v2-708d9e36af1c275074cd5e0f0c0da923_b.jpg" data-caption="" data-size="normal" data-rawwidth="647" data-rawheight="247" class="origin_image zh-lightbox-thumb" width="647" data-original="https://pic4.zhimg.com/v2-708d9e36af1c275074cd5e0f0c0da923_r.jpg"/>

RX_ER: Physical layer reception error, such as abnormal interruption after half of data reception, no data.


PCS sublayer packet structure: The packet structure of the physical layer is consistent with the frame structure of the MAC layer.

<img src="https://pic3.zhimg.com/v2-bd0b9acab2e23616da80763da1174a1a_b.jpg" data-caption="" data-size="normal" data-rawwidth="585" data-rawheight="140" class="origin_image zh-lightbox-thumb" width="585" data-original="https://pic3.zhimg.com/v2-bd0b9acab2e23616da80763da1174a1a_r.jpg"/>

Coding of PCS sub-layer

An important function of physical layer encoding is to encode the original physical layer frame data into binary data suitable for physical line transmission. It is mainly used for link control, error detection, error correction and retransmission after errors.

<img src="https://pic3.zhimg.com/v2-53486b15ca2c28bf6f913f7ec8cb2a5a_b.jpg" data-caption="" data-size="normal" data-rawwidth="670" data-rawheight="460" class="origin_image zh-lightbox-thumb" width="670" data-original="https://pic3.zhimg.com/v2-53486b15ca2c28bf6f913f7ec8cb2a5a_r.jpg"/>

Compared with the 10M rate physical link, the 100M rate, the binary data rate is increased by a full 10 times, resulting in an increase in interference between each communication node, and a sharp increase in the impact of interference from line noise. Therefore, it is necessary to Certain data encoding is used for link control, error detection, error correction and retransmission after errors.

From the above figure, it can be seen that compared to the 10M rate, 4B/5B encoding/decoding, scrambling/descrambling are added.

(A) 4B/5B encoding and decoding

The 4B/5B coding scheme is a coding scheme that converts 4-bit binary data into 5-bit binary data.

The characteristic of this encoding is to treat every 4 bits of the data stream to be sent as a group, and then convert it into the corresponding 5-bit encoding according to the 4B/5B encoding rules.

There are 32 combinations of 5-bit codes:

16 of these combinations are used to carry 4 bits of data.

The other 16 combinations are used as link control codes or are reserved for use, such as indicating the start and end of the frame, the status of the physical line (quiescent, idle, paused), etc.

The following is the Ethernet 4B/5B data code mapping table:

<img src="https://pic2.zhimg.com/v2-f6164dcad7ed6fc6290609cf50a895d1_b.jpg" data-caption="" data-size="normal" data-rawwidth="685" data-rawheight="428" class="origin_image zh-lightbox-thumb" width="685" data-original="https://pic2.zhimg.com/v2-f6164dcad7ed6fc6290609cf50a895d1_r.jpg"/>

The 4-bit 0000 is encoded into the 5-bit 11110;

The 4-bit 1111 is encoded into the 5-bit 11101;

Data coding efficiency = 4/5 = 80%, that is, 80% coding efficiency.

4B/5B encoding also has an important feature: even if the original 4-bit data has 4 all 0s or 3 0s, in the encoded 5B special data, the number of 0s is at most 2. like:

0000 is encoded into 11110 => 4 1s, 1 0

0001 is encoded into 10101 => 3 1s, 2 0s

The following is the Ethernet 4B/5B control code encoding table:

<img src="https://pic3.zhimg.com/v2-6a3507709271730911433b95ec3452ea_b.jpg" data-caption="" data-size="normal" data-rawwidth="660" data-rawheight="473" class="origin_image zh-lightbox-thumb" width="660" data-original="https://pic3.zhimg.com/v2-6a3507709271730911433b95ec3452ea_r.jpg"/>

11111: Used as filler characters between physical layer data streams to indicate idle status without valid data. It is mainly used to maintain link clock synchronization.

11000/10001: The start mark of the physical layer data stream . The first byte of the preamble of the MAC layer frame is mapped to this 5B encoding.

01101/00111: The end flag of the physical layer data stream . There is no corresponding bit field of the MAC layer frame corresponding to it, corresponding to TX_EN and RX_DV.

When sending data, the electrical signal TX_EN between the MAC layer and the PHY layer changes from high level to low level, and is automatically converted into the end mark of the physical layer data flow .

When receiving data, the physical layer receives the end flag of the physical layer data stream and automatically changes the electrical signal RX_DV between the MAC layer and the PHY layer from high level to low level to notify the MAC layer that the data transmission is completed.

Benefits of 4B/5B encoding:

  • The main purpose of using 4B/5B encoding is to reduce the occurrence of multiple consecutive 0s or 1s on the transmission line, which is beneficial to the receiving end in extracting the clock signal. Also known as maintaining the alternating current (AC) balance of the line, used in conjunction with NRZI encoding.
  • The additional 5-bit control code is used by both communicating parties to monitor and control the physical link between the physical layer PCS sub-layer entities.
  • The additional 5-bit control code is used by the physical layer entity PCS sublayer to feed back the monitored link status to the MAC layer through the signal pins of the chip.

The structure of the PCS sublayer data stream (4B/5B encoded physical layer bit stream)

<img src="https://pic4.zhimg.com/v2-84eaa558f55adfab9b5ecc535a8cd7a3_b.jpg" data-caption="" data-size="normal" data-rawwidth="585" data-rawheight="375" class="origin_image zh-lightbox-thumb" width="585" data-original="https://pic4.zhimg.com/v2-84eaa558f55adfab9b5ecc535a8cd7a3_r.jpg"/>
  • SSD (11000/10001): The physical layer uses this 5B control code to replace the first byte of the preamble of the MAC layer frame.
  • ESD (01101/00111): The physical layer uses this 5B control code and adds it to the end of the MAC layer frame.
  • IDLE (11111): Physical layer idle indication, used for clock synchronization.

The above 5B control code is invisible to the MAC layer and terminates at the PCS sublayer.

(B) Scrambling and decoding

Scrambling is a digital signal processing method, which uses a binary scrambling code to multiply the original binary data to obtain new binary data.

The new binary is fragmented in time compared to the original binary.

In general, the design of digital communication systems and their performance are related to the statistical properties of the transmitted digital signals.

Through scrambling technology, the bit order of the original data is disrupted without adding new data bits, and the statistical characteristics of the digital signal are changed to make it approximate the statistical characteristics of white noise. The basis of this technology is based on the theory of feedback shift register sequence (a pseudo-random sequence).


PMA sublayer: physical medium connection sublayer

PMA functions include

  • The sending direction is parallel-to-serial conversion, and the receiving direction is serial-to-parallel conversion.
  • physical layer signal encoding
  • Physical link clock synthesis/recovery.

The PMA receives the parallel bit stream from the PCS and then converts it into a serial bit stream and sends it to the PMD layer.

PMA uses a digital phase-locked loop (PLL) to send a binary bit stream according to a standard clock interface at the transmitting end, and the PLL at the receiving end synchronizes the serial binary stream to extract the clock.

(1) Parallel-to-serial conversion

There is not much to say about this, it is 5-bit parallel data that is converted into 1-bit serial data for line transmission.

(2) Physical layer signal coding

In the case of 10M rate system, Manchester encoding is used, that is, a complete sine wave or a square wave signal represented by cosine is used to represent 0 or 1. The advantage of this encoding scheme is that while transmitting data, it also A clock cycle capable of transmitting data bits without the need for a dedicated clock signal to transmit clock signals on both sides of the transmitter and receiver.

But the shortcomings are also obvious. The frequency of the encoded signal is twice the frequency of the data before encoding, that is, the encoding efficiency is only 50%.

Is there a coding method that can transmit both clock signals and data, and the signal coding efficiency is 100%? Apparently none have been found yet.

I2C and SPI serial communication using return-to-zero code NRZ encoding, the signal cycle completely corresponds to the binary data cycle, and the coding efficiency reaches 100%. However, both ends of the serial communication require special clock signal lines to transmit the clock .

So, is there a coding method that can transmit both clock signals and data, and the signal coding efficiency is between 50% and 100%?

In the case of Ethernet 100M rate, this effect can be achieved by using the 4B/5B+NRZI mixed encoding method.

NRZI coding efficiency is 100% and can ensure that clock information can be transmitted while transmitting data "1". However, in the case of passing data "0", the clock information cannot be passed.

4B/5B encoding can ensure that (1) the encoding efficiency reaches 80%; (2) even if the user data contains consecutive 0 bits, this encoding can avoid the continuous transmission of 0 bits.

The combined encoding of NRZI + 4B/5B achieves this effect: it can transmit both clock signals and data, and the signal encoding efficiency is 80%.

Non-return-to-zero code NRZ, Manchester coding, differential Manchester coding, and 4B/5B coding have been discussed before. Here, let’s discuss NRZI.

NRZI (Non Return to Zero Inverted), which is non-return to zero inverted coding, NRZI combines the ideas of NRZ and differential Manchester coding.

First of all, the basis of NRZI is the non-return-to-zero code NRZ, so the symbols of the electrical signal are high level and low level, and the period is the same as the period of the binary data.

However, in order to transmit clock information, this encoding does not directly use high level or low level to represent 0 or 1 data, but relies on the idea of ​​differential Manchester encoding, that is, it is represented by the change of the two level signals before and after. 1 and 0.

If the two levels before and after remain unchanged (continuous low level or continuous high level), it means data "0";

If the two levels before and after change (a high level + a low level or a low level + a high level), it means the data is "1".

In order to better understand NRZI, see the following diagram:

<img src="https://pic1.zhimg.com/v2-696089cdfec767b05c221fb6f71502dc_b.jpg" data-caption="" data-size="normal" data-rawwidth="497" data-rawheight="241" class="origin_image zh-lightbox-thumb" width="497" data-original="https://pic1.zhimg.com/v2-696089cdfec767b05c221fb6f71502dc_r.jpg"/>

NRZI encoding of all “1” data:

<img src="https://pic4.zhimg.com/v2-31ebd849815b71e05597187927b3f78b_b.jpg" data-caption="" data-size="normal" data-rawwidth="457" data-rawheight="175" class="origin_image zh-lightbox-thumb" width="457" data-original="https://pic4.zhimg.com/v2-31ebd849815b71e05597187927b3f78b_r.jpg"/>

The NRZI encoding of all 1 binary bits is a square wave periodic signal with the same rate as the data bit rate.

NRZI encoding of all "0" data:

<img src="https://pic1.zhimg.com/v2-5eef383440d5c5c2195385b01ffb6a68_b.jpg" data-caption="" data-size="normal" data-rawwidth="452" data-rawheight="232" class="origin_image zh-lightbox-thumb" width="452" data-original="https://pic1.zhimg.com/v2-5eef383440d5c5c2195385b01ffb6a68_r.jpg"/>

The NRZI encoding of all 0 binary bits is a constant low level or constant high level signal without clock information.

This is the biggest flaw of NRZI encoding! !

Fortunately, 4B/5B encoding makes up for this defect. After 4B/5B encoding, the situation of all 0s is avoided. Any 4-bit data will be encoded into 5-bit data containing at least 3 1s.

<img src="https://pic2.zhimg.com/v2-f6164dcad7ed6fc6290609cf50a895d1_b.jpg" data-caption="" data-size="normal" data-rawwidth="685" data-rawheight="428" class="origin_image zh-lightbox-thumb" width="685" data-original="https://pic2.zhimg.com/v2-f6164dcad7ed6fc6290609cf50a895d1_r.jpg"/>

And the 5-bit 11111 is encoded into an idle control code, which is used to transmit the clock synchronization signal when there is no data transmission:

<img src="https://pic3.zhimg.com/v2-6a3507709271730911433b95ec3452ea_b.jpg" data-caption="" data-size="normal" data-rawwidth="660" data-rawheight="473" class="origin_image zh-lightbox-thumb" width="660" data-original="https://pic3.zhimg.com/v2-6a3507709271730911433b95ec3452ea_r.jpg"/>

———————————————————————————————————————

PMD sublayer​

<img src="https://pic3.zhimg.com/v2-8817c3241e063c4fc4e691398b65553e_b.jpg" data-caption="" data-size="normal" data-rawwidth="684" data-rawheight="438" class="origin_image zh-lightbox-thumb" width="684" data-original="https://pic3.zhimg.com/v2-8817c3241e063c4fc4e691398b65553e_r.jpg"/>

The PMD sublayer is located at the bottom of the entire network, and is only applicable to >=100M rate situations. It is mainly used to complete

(1) MDI output signal

<img src="https://pic4.zhimg.com/v2-18ebbe10cef8946baa2d72fabd47968f_b.jpg" data-caption="" data-size="normal" data-rawwidth="720" data-rawheight="766" class="origin_image zh-lightbox-thumb" width="720" data-original="https://pic4.zhimg.com/v2-18ebbe10cef8946baa2d72fabd47968f_r.jpg"/>
<img src="https://pic1.zhimg.com/v2-c54e5cb65cff304b06b6eb9cea946164_b.jpg" data-caption="" data-size="normal" data-rawwidth="503" data-rawheight="430" class="origin_image zh-lightbox-thumb" width="503" data-original="https://pic1.zhimg.com/v2-c54e5cb65cff304b06b6eb9cea946164_r.jpg"/>

The interface signals of MDI are differential signals, such as Tx+, TX-, which are a pair of differential signals.

Differential transmission is a signal transmission technology. Different from the traditional method of one signal line and one ground wire, differential transmission transmits signals on both lines. The amplitude of the two signals is the same and the phase is opposite . The signals transmitted on these two lines are differential signals .

The signal receiving end compares the difference between these two voltages to determine the logic state sent by the transmitting end.

Strictly speaking, all voltage signals are differential , since one voltage can only be relative to another voltage.

In non-differential signaling systems, "system ground" is used as the voltage reference point. When 'ground' is used as a voltage measurement reference, the signal is called a single-ended voltage.

When a voltage of equal amplitude and opposite phase is added to two conductors at the same time, which is the so-called common mode signal, the signal value is the voltage difference between the two conductors.

The first benefit of differential signaling is that the signal transmitted on the line contains a self-contained "reference signal", so small signals can be easily identified . In a system with a ground-referenced single-ended signal scheme, the precise value of the measured signal depends on the consistency of the ground within the system. The farther away the signal source and signal receiver are, the greater the possibility of a difference between their local ground voltage values, so the amplitude of the transmitted signal cannot be too low. The signal value recovered by a differential signal is largely independent of the precise value of the system 'ground' signals on both sides, and is only related to the amplitude difference of the transmitted signal.

The second major benefit of differential signaling is that it is highly immune to external electromagnetic interference ( EMI Electromagnetic Interference). An interferer affects each end of a differential signal pair almost equally. Since the voltage difference determines the signal value, this will ignore any identical interference occurring on both conductors . In addition to being less sensitive to interference , differential signals generate less EMI than single-ended signals.

A third benefit offered by differential signaling is the ability to handle 'bipolar' (positive and negative) signals with ease and precision in a single- supply system . In order to handle bipolar signals in single-ended, single-supply systems, we must establish a virtual ground at some arbitrary voltage between ground and the power rail (usually the midpoint) . A voltage higher than the virtual ground is used to represent the positive signal, and a voltage lower than the virtual ground is used to represent the negative signal. Next, the virtual land must be correctly distributed throughout the system. For differential signals, there is no need for such a virtual ground, which allows us to process and propagate bipolar signals with high fidelity without relying on the stability of the virtual ground.

(2) Network transformer

There is a network transformer before the physical layer chip output and the RJ45 line signal output to isolate electrical signals.

<img src="https://pic3.zhimg.com/v2-a4246aee6d3339cf7d39f7e7ccb6456e_b.jpg" data-caption="" data-size="normal" data-rawwidth="640" data-rawheight="434" class="origin_image zh-lightbox-thumb" width="640" data-original="https://pic3.zhimg.com/v2-a4246aee6d3339cf7d39f7e7ccb6456e_r.jpg"/>

Transformer function

electrical isolation

The signal level generated by any CMOS chip when working is always greater than 0V. If the PHY output signal is sent to a place of 100 meters or even longer, there will be a great loss of DC component. And if the external network cable is directly connected to the chip, electromagnetic induction (thunder) and static electricity can easily cause damage to the chip. The network transformer itself is designed to withstand voltages of 2KV~3KV. It also plays a role in lightning protection.

Furthermore, different grounding methods of equipment and different power grid environments will lead to inconsistent 0V levels on both sides. In this way, when the signal is transmitted from A to B, since the 0V level of equipment A is different from the 0V level of point B, this may cause a big problem. Electric current flows from a device with a higher potential to a device with a lower potential.

The network transformer filters the differential signal sent out by the PHY with differential mode coupling coil coupling to enhance the signal, and couples it to the other end of the connecting network cable through electromagnetic field conversion. This not only allows the signal to be transmitted without a physical connection between the network cable and the PHY, but also cuts off the DC component in the signal. It can also transmit data in devices with different 0V levels.

From this perspective, the network transformer is a bit like an "antenna": the electrical signal on the device is "coupled" into the RJ45 line through the transformer, just like the antenna couples the electrical signal into an electromagnetic wave signal and sends it into space.

Common mode rejection

Each pair of signal wires (such as Tx+, Tx-) in a twisted pair is wound around each other in a double helix structure. The telecommunications flowing through each wire have the same amplitude and a phase difference of 180 degrees. Therefore, the magnetic field generated is restricted and offset by the spiral shape, preventing the energy dissipation loss during the signal self-transmission process.

That is, for differential mode signals, the current on each wire is transmitted in opposite directions (a pair of positive and negative signals with equal amplitude) on a pair of wires. If the pair of wires were evenly wound, these opposing currents would produce equal and oppositely polarized magnetic fields, causing their outputs to cancel each other out.

At this point, the exact opposite of the antenna:

The current in the antenna flows in the same direction on the two wires and returns to ground through the parasitic capacitance CP. In this case, the currents produce magnetic fields of equal magnitude and polarity, and their outputs cannot cancel each other. The common-mode current generates an electromagnetic field on the surface of the twisted pair, and the electrical signal is emitted into the space through the electromagnetic field.

(3) SFP optical signal interface: optical fiber connection, electrical/optical conversion and other functions.

PMD is completed by the electrical/optical transceiver SFP. The SFP optical module is the core device of optical communication. It is an interface module that realizes information transmission between devices through photoelectric conversion. It consists of a receiving part and a transmitting part. The transmitting end converts the electrical signal into an optical signal, and after transmitting it through the optical fiber, the receiving end converts the optical signal into an electrical signal, and the transmission medium is optical fiber.

<img src="https://pic1.zhimg.com/v2-31e74536a11d7b2bc99c9bb1649cf270_b.jpg" data-caption="" data-size="normal" data-rawwidth="640" data-rawheight="322" class="origin_image zh-lightbox-thumb" width="640" data-original="https://pic1.zhimg.com/v2-31e74536a11d7b2bc99c9bb1649cf270_r.jpg"/>

Signal interface between SFP and physical layer chip:

<img src="https://pic4.zhimg.com/v2-25e2562f2fa4c2a25a2e65a326d5754f_b.jpg" data-caption="" data-size="normal" data-rawwidth="551" data-rawheight="461" class="origin_image zh-lightbox-thumb" width="551" data-original="https://pic4.zhimg.com/v2-25e2562f2fa4c2a25a2e65a326d5754f_r.jpg"/>

Principle of launch part

The electrical signal with a certain code rate is input and processed by the internal driver chip to drive the semiconductor laser (LD) or light-emitting diode (LED) to emit a modulated optical signal at a corresponding rate. There is an automatic optical power control circuit (APC) inside, so that the output The optical signal power remains stable.

<img src="https://pic1.zhimg.com/v2-c21e8950e2c31ba815e24c18598ad0d8_b.jpg" data-caption="" data-size="normal" data-rawwidth="640" data-rawheight="161" class="origin_image zh-lightbox-thumb" width="640" data-original="https://pic1.zhimg.com/v2-c21e8950e2c31ba815e24c18598ad0d8_r.jpg"/>

Receiving part principle

The optical signal with a certain code rate is input into the module and converted into an electrical signal by the light detection diode. After passing through the preamplifier, the electrical signal with the corresponding code rate is output. At the same time, an alarm signal will be output when the input optical power is less than a certain value.

<img src="https://pic3.zhimg.com/v2-18181d6ac5eb15c38e84d7f7f91bb176_b.jpg" data-caption="" data-size="normal" data-rawwidth="640" data-rawheight="163" class="origin_image zh-lightbox-thumb" width="640" data-original="https://pic3.zhimg.com/v2-18181d6ac5eb15c38e84d7f7f91bb176_r.jpg"/>

The main parameters and significance of optical modules

Transmission rate

The transmission rate refers to the number of bits transmitted per second, in Mbps or Gbps.

Currently commonly used transmission rates are 155Mbps, 1.25Gbps, 2.5Gbps, 10Gbps, etc.

Transmission distance

Optical modules generally have multi-mode 550m, single-mode 15km, 40km, 80km and 120km, etc.

The transmission distance of optical modules is divided into three types: short distance, medium distance and long distance. The general division is as follows:

<img src="https://pic4.zhimg.com/v2-147c48266deac43d17da5cf2199beeb7_b.jpg" data-caption="" data-size="normal" data-rawwidth="527" data-rawheight="157" class="origin_image zh-lightbox-thumb" width="527" data-original="https://pic4.zhimg.com/v2-147c48266deac43d17da5cf2199beeb7_r.jpg"/>

There will be certain loss and dispersion when optical signals are transmitted in optical fibers, which is the main reason why the transmission distance of optical modules is limited.

central wavelength

The center wavelength refers to the optical band used for optical signal transmission, in nanometers (nm). Currently, there are mainly 850nm band, 1310nm band and 1550nm band.

<img src="https://pic3.zhimg.com/v2-0783a3137ca333199a881a5e2d43b7fa_b.jpg" data-caption="" data-size="normal" data-rawwidth="566" data-rawheight="196" class="origin_image zh-lightbox-thumb" width="566" data-original="https://pic3.zhimg.com/v2-0783a3137ca333199a881a5e2d43b7fa_r.jpg"/>


How electrical signals are modulated onto optical signals will be discussed in a separate chapter.

At this point, the binary data of the user data corresponding to "I Love you" has been converted into relevant electrical signals through Ethernet MAC layer encapsulation, physical layer digital encoding, and electrical signal symbol encoding, and then passed through the network transformer or SFP photoelectric conversion device, it can be sent on the physical line.

<img src="https://pic1.zhimg.com/v2-d7fdefc2ddbc8dcef57bdae83f9ddac4_b.jpg" data-caption="" data-size="normal" data-rawwidth="435" data-rawheight="627" class="origin_image zh-lightbox-thumb" width="435" data-original="https://pic1.zhimg.com/v2-d7fdefc2ddbc8dcef57bdae83f9ddac4_r.jpg"/>

6. Channel-to-information transmission process

The channels here mainly refer to RJ45 twisted pair channels and fiber optic channels.


<img src="https://pic2.zhimg.com/v2-5b0ed3b07c72e3fca5a04e590d36936d_b.jpg" data-caption="" data-size="normal" data-rawwidth="600" data-rawheight="600" class="origin_image zh-lightbox-thumb" width="600" data-original="https://pic2.zhimg.com/v2-5b0ed3b07c72e3fca5a04e590d36936d_r.jpg"/>



<img src="https://pic1.zhimg.com/v2-fb819af4c48c571f2064182c4b092958_b.jpg" data-caption="" data-size="normal" data-rawwidth="400" data-rawheight="348" class="content_image" width="400"/>



<img src="https://pic3.zhimg.com/v2-22f85678b9561d2bb686c5ebf21ee866_b.jpg" data-caption="" data-size="normal" data-rawwidth="534" data-rawheight="300" class="origin_image zh-lightbox-thumb" width="534" data-original="https://pic3.zhimg.com/v2-22f85678b9561d2bb686c5ebf21ee866_r.jpg"/>

7. Information reception process and key principles of Xinsu

1. Ethernet decoding process

<img src="https://pic2.zhimg.com/v2-ac05d6032440839dedb5063f10085ce5_b.jpg" data-caption="" data-size="normal" data-rawwidth="435" data-rawheight="627" class="origin_image zh-lightbox-thumb" width="435" data-original="https://pic2.zhimg.com/v2-ac05d6032440839dedb5063f10085ce5_r.jpg"/>

2. Information receiving process

<img src="https://pic1.zhimg.com/v2-df713300fdd48cd1d2c8b6e4e28ac4d4_b.jpg" data-caption="" data-size="normal" data-rawwidth="786" data-rawheight="555" class="origin_image zh-lightbox-thumb" width="786" data-original="https://pic1.zhimg.com/v2-df713300fdd48cd1d2c8b6e4e28ac4d4_r.jpg"/>

The reception of information by the sink is the reverse process of the sending process of the signal.

(1) Signal reception:

If it is a 10/100M electrical port, the main thing here is the reception of physical signals by the RJ45 port and the network transformer.

If it is a 100M optical port, the SFP photoelectric converter mainly receives the optical signal and converts it into an electrical signal.

(2) Physical layer electrical signal decoding or symbol decoding

If it is a 10 electrical port, it is mainly Manchester encoding and decoding.

If it is 100M electrical/optical, the main thing here is NRZI decoding.

(3) Physical layer channel decoding: If it is 100M electrical/optical, it is mainly scrambling and 4B/5B encoding.

(4) Network decoding: decoding MAC layer deframing and CRC check.

(5) Data: After CRC check and MAC frame decoding, the binary ASCII encoded data corresponding to "I Love You" is obtained.

(6) Xinsu: Beauty B

Beauty B is a programmer. Through binary, she directly translated it into "I Love You" and felt the deep love of handsome guy A.

At this point, the entire Ethernet communication case has been introduced.

Further reading:

Signal waveform and spectrum

Lezhu: Network layer receives messages - fragmented assembly

09 On how data is sliced-IP slicing and IP header explanation

Edited on 2022-12-22 18:04 ・IP is located in Beijing
communication
principle
information communication
​Like 89 ​​10 comments
Share
​Like ​Collect ​Apply for reprinting

Guess you like

Origin blog.csdn.net/han_better/article/details/130583836
Recommended