How do PPP or Ethernet recover from errors?

Looking at data link layer standards such as PPP common frame format or Ethernet , it is not clear what will happen if the checksum is invalid. How does the protocol know where the next frame begins?

Does it only check the next occurrence of the โ€œflagโ€ (in the case of PPP)? If so, what happens if batch loading so easily contains a โ€œflagโ€? My point is that whether packets with frames or โ€œlengthsโ€ are used, it is not clear how to recover from invalid packets, where the โ€œlengthโ€ field may be damaged, or the โ€œbyteโ€ bytes may simply be part of the packet load.

UPDATE I found what I was looking for (which is not quite what I asked for) by looking at the "GFP-based CRC-based framework." According to the Communication Network

The GFP receiver synchronizes with the border of the GFP frame through a three-state process. The receiver is initially in search mode, where it parses four bytes at a time to see if the CRC is calculated over the first two bytes equal to the contents of the next two bytes. If no match is found, the GFP moves forward one byte, because the GFP assumes a synchronous oxet transmission defined by the physical layer. When the receiver finds a match, it enters the pre-synchronization state. In this intermediate state, the receiver uses the preliminary PLI indicator field (payload length value) to determine the location of the next frame boundary. If the target number N of successful frame detection is reached, then the receiver enters the synchronization state. The synchronization state is the normal state in which the receiver checks each PLI, checks it with cHEC (kernel header error checking), extracts the payload, and moves on to the next frame.

In short, each packet starts with "length" and "CRC (length)". No characters need to be avoided, and the packet length is known in advance.

There seem to be two main approaches to batch cropping:

  • encoding schemes (bit / byte filling, Manchester encoding, 4b5b, 8b10b, etc.)
  • unmodified data + checksum (GFP)

The former is safer, the latter is more effective. Both are error prone, if only the payload contains acceptable packet and line damage, causes the processing bytes to contain a sequence of bytes of frame start, but this sounds very unlikely. Hard numbers are hard to find for GFP reliability, but many modern protocols seem to use it, so they can be assumed to know what they are doing.

+6
error-handling ethernet ppp
source share
4 answers

You have come close to the correct answer. Basically, if it starts with the preamble and ends with something that matches the checksum, this is a frame and is transferred to higher levels.

PPP and ethernet look for the next frame trigger signal. In the case of Ethernet, this is a preamble, a sequence of 64 alternating bits. If the Ethernet decoder sees this, it simply assumes that it follows the frame. By capturing the bit, and then checking to see if the checksum matches, it decides if it has a valid frame.

As for the payload containing FLAG in PPP, it is escaped with extra bytes to prevent such a misinterpretation.

+5
source share

Both PPP and Ethernet have mechanisms for framing, that is, for splitting the bitstream into frames in such a way that if the receiver loses information about what he can pick up at the beginning of the next frame, they are located at the bottom of the protocol stack; all other protocol details are based on the idea of โ€‹โ€‹frames. In particular, the preamble, LCP, and FCS are at a higher level and are not used to control framing.

PPP through serial links such as dialup is framed using HDLC-like framing . The byte value 0x7e, called a sequence of flags, indicates the beginning of the frame. The frame continues until the next byte. Any appearance of a byte flag in the contents of the frame is escaped. Escaping is done by writing 0x7d, known as a control escape byte, followed by a byte that must be escaped xor'd with 0x20. The flag sequence resets to 0x5e; escape control itself must also be escaped, up to 0x5d. Other values โ€‹โ€‹can also be shielded if their presence disrupts the modem. As a result, if the receiver loses synchronization, it can simply read and discard bytes until it sees 0x7e, after which it again recognizes it at the beginning of the frame. The contents of the frame are then structured, containing several odd small fields that are not very important, but are saved from an earlier IBM protocol along with a PPP packet (called a protocol data unit, PDU), as well as frame check (FCS).

Ethernet uses a logically similar approach, having characters that are recognized as a start and end marker, rather than data, but instead of having reserved bytes plus an evacuation mechanism, it uses a coding scheme that can express special control characters that differ from data bytes - A bit like using punctuation to break a sequence of letters. The details of the system used vary with speed.

Standard (10 Mbit / s) ethernet is encoded using Manchester coding , in which each bit to be transmitted is represented as two consecutive levels on a line, so that there is always a transition between the levels in each bit, which helps the receiver stay synchronized . The borders of the frame are indicated by a violation of the encoding rule, which leads to the fact that the bit has no transition (I read this in a book several years ago, but I can not find the link on the Internet - maybe I'm wrong). In essence, this system extends the binary code to three characters - 0, 1 and violations.

Fast (100 Mbps) ethernet uses a different coding scheme based on the 5b / 4b code , where groups of four data bits (nybbles) are represented as groups of five bits on a wire and are transmitted directly, without a Manchester scheme. Extending to five bits allows you to select sixteen necessary patterns to meet the requirements for frequent level transitions to help synchronize the receiver. However, there is still room for selecting additional characters that can be transmitted but do not match the data value, essentially expanding the set of nybbles to 24 characters - nybbles from 0 to F and characters called Q, I, J, K, T, R, S, and H. Ethernet uses a JK pair to mark the start of a frame, and TR uses a pair of JK to mark the end of a frame.

Gigabit ethernet is similar to fast ethernet, but with a different coding scheme - optical fiber versions use 8b / 10b code instead of 5b / 4b, and the twisted pair version uses a very complex binary code structure that I really don't understand. Both approaches give the same result, which is the ability to transmit either data bytes, or one of a small set of additional special characters, and these special characters are used to crop.

In addition to this basic structure structure, then there is a fixed preamble followed by a frame divider, as well as some control fields of various meaninglessness (hello, LLC / SNAP!). The validity of these fields can be used to verify the frame, but they cannot be used to determine the frames on their own.

+9
source share

This section of the "Wikipedia PPP line" section describes the basics of RFC 1661. The frame check sequence is used to detect transmission errors in the frame (described in the previous Encapsulation section).

The diagram from RFC 1661 on this page on Wikipedia describes how the phase of the network protocol can restart with communication failure.


Also notes from the Cisco page that Suves links to.

PPP Link-Control Protocol

PPP LCP provides a way to establish, configure, maintain, and terminate a point-to-point connection. LCP goes through four different phases.

Firstly, communication is established and configuration agreed. Before exchanging network-level datagrams (such as IP), the LCP must first open the connection and agree on the configuration parameters. This phase ends when the configuration confirmation frame has been sent and received.

This is followed by a definition of link quality. LCP allows the optional step of determining the quality of communication after the step of establishing a connection and negotiating a configuration. At this point, the link is tested to determine if the link quality is sufficient to recreate the network layer protocols. This phase is optional. The LCP may delay the transmission of network layer protocol information until this phase is completed.

At this point, the network layer protocol configuration is negotiated. After the LCP completes the communication quality determination phase, the network layer protocols can be configured separately by the respective NCP and can be raised and removed at any time. If the LCP closes the link, it informs the network layer protocols so that they can take appropriate action.

Finally, the connection is completed. LCP may disconnect at any time. This is usually done at the request of the user, but may occur due to a physical event, such as loss of carrier or the expiration of the timeout timer.

There are three classes of LCP frames. Linking frames are used to establish and configure links. Communication termination frames are used to terminate communications, and link maintenance frames are used to manage and debug links.

These frames are used to complete the work of each of the phases of the LCP.

+1
source share

As far as I know, PPP only supports error detection and does not support any form of error correction or recovery.

Cisco backup here: http://www.cisco.com/en/US/docs/internetworking/technology/handbook/PPP.html

+1
source share

All Articles