Home  >  Article  >  Operation and Maintenance  >  How to analyze data link protocols HDLC and PPP

How to analyze data link protocols HDLC and PPP

WBOY
WBOYforward
2023-05-12 14:43:112517browse

1. Commonly used data link protocols (HDLC, PPP)

(1) Ideas for analyzing the protocol

Step 1: Understand the overview of the protocol, know The purpose and basic characteristics of this protocol design

Step 2: Use the format of the protocol data unit (frame for the data link layer) as the main clue to study the specific implementation steps of the protocol

Three: How does the agreement solve practical problems?

(2) HDLC protocol (Advanced Data Link Control Procedure) (bit-oriented protocol)

The HDLC protocol is a bit-oriented protocol, which mainly solves the problem of data link layer link management , addressing, frame synchronization, error control, and flow control. It has the characteristics of a balanced system and an unbalanced system.

1. Composition of HDLC:

Frame structure (syntax)

Procedure elements (syntax)

Rule type (semantics)

Use HDLC syntax to define multiple link layer protocols with different operating characteristics.

2. Description of HDLC

HDLC puts forward three levels of concepts when describing:

(1) Classification of all nodes participating in communication (data station): Main Station, secondary station, combined station.

In the previous centralized control of multi-terminal online systems centered on a single processor, the primary station and the secondary station appeared in pairs, but for the current distributed structure (such as packet switching network) Say, all sites are combined sites.

(2) Link type: balanced, unbalanced.

Centralized control is unbalanced, while distributed control is balanced

(3) Operation mode: regular response mode, asynchronous response mode, asynchronous balance mode

For the balanced type, it only has asynchronous balanced mode, that is, each site sends out communications independently, which is an autonomous system. For the unbalanced type composed of a primary station and a secondary station, there is a formal response mode, that is, the secondary station must be controlled by the primary station and cannot initiate data transmission without the permission of the primary station. In the asynchronous response mode, the secondary station can actively initiate data transmission.

3. Format of HDLC protocol data unit (frame format)

How to analyze data link protocols HDLC and PPP

(1) Flag field: The first and last fields of the frame can be seen in the content. They are all composed of "01111110", which is used to divide the starting position and ending position of the frame

(2) Address field: It has two flaws: First, because it was centered on a single processor at that time It is designed for a multi-terminal online system, so there is only one address (terminal address), which is not suitable for current distributed computer systems. Second, the address is only 8 bits, which means it can only represent up to 256 nodes.

(3) Information field: The user data part of the protocol data unit, the length is variable, but is generally 1500 bytes.

(4) Frame check sequence: Use CRC check method.

(5) Information frame: The sender uses a fixed-size sliding window protocol when sending data (the window size is fixed to 7)

4. Type of HDLC frame

Frame type: (1) Information frame: a frame used to transmit data for upper-layer entities

(2) Monitoring frame: for error control and flow control

(3) Unsequenced frame: Link management control, responsible for negotiating how the two parties communicate and how to use the channel

(3) Protocol engineering design

1. Protocol description (requirements analysis, functional design): generally no natural language description is required ( Redundancy, ambiguity, poor structure). And use finite state machine (FSM), Petri net and other forms to describe

2. Protocol verification (whether the protocol working mode takes into account all the problems encountered in the network environment and whether it can operate normally)

3. Protocol testing: conformance testing, interoperability testing, performance testing

4. Finite state machine: It believes that any protocol is to describe various states in the network, and the states are limited .

(1) A finite state machine is a four-tuple (S, M, I, T)

S is a set of states, M is a set of labels, I is a set of states, T is a set of transitions

The basic idea is: when a transition occurs, it will migrate from one state to another state, and the cause of the transition is the command from the user, the arrival of information, and the internal timeout Waiting event

(2) Status example: Simplex stop and wait protocol with channel error

Use triple XYZ to represent the status: XYZ

X: The sender is sending The frame sequence number, which is 0 or 1

Y: The frame sequence number that the receiver is waiting for, which is 0 or 1; frame),

1 (indicating that frame number 1 is being transmitted),

A (the channel is transmitting a response frame)

or - (empty) (indicating that the channel is not transmitting data or the transmitted data is incorrect)

Its initial state is 000

How to analyze data link protocols HDLC and PPP

(3) Advantages: Simple and clear, relatively accurate

Disadvantages: For complex protocols, the number of events and states will increase, making processing difficult.

5, perti net

(1) Element:

Position: Describe the system status, represented by a circle

Transition: Describe the modification of the system status Events are represented by a rectangle or line segment

Arc: Describes the relationship between states and events, including input arcs and output arcs, represented by directed arcs.

Black spot: Mark, it is the current status

How to analyze data link protocols HDLC and PPP

The picture shows the preti description of the error-free single-work stop waiting agreement. Its biggest feature is that it can be used independently Describe three different states

(4) Data link layer of the Internet

1. Two main situations of point-to-point communication (the main occasions where Internet works):

(1) router to router:

(2) Dial the Internet through the modem, or connect to the access server

to access to the Internet If you want to connect to the internet, there is a router or host connected to it. You must apply for a connection before you can access), dedicated line access (the line is open in real time, and data transmission can be completed without applying)

2. SLIP (Serial LINE) IP Serial Line IP Protocol)

This protocol was proposed in 1984 to send original IP data packets, delimited by a mark byte (0Xc0), and using character padding technology. Its main problems are that it does not provide error checking, can only support IP protocols and IP addresses cannot be dynamically assigned, does not support authentication, and is incompatible with multiple versions. It is no longer used.

3. PPP (point-to-point Protocol) protocol (RFC 1661 16621663)

(1) Features: Provide error checking, support multiple protocols, allow dynamic IP addresses, support Identity Authentication

(2) Different from SLIP, it does not send original IP data packets, but is transmitted in frame bit units.

(3) In order to increase the adaptability and flexibility of the protocol, the PPP protocol is divided into two parts. One part is the link control protocol LCP (LinkControl Protocol), which can establish and test a variety of physical layer services. , allowing this data link layer to support a richer variety of types

(4)PPPoE (Point to Point Protocol over Ethernet) is a point-to-point communication protocol based on Ethernet

(5) Frame format : The frame format of PPP protocol is basically the same as that of HDLC protocol, but there are two differences: first, HDLC protocol is bit-oriented, while PPP protocol is character-oriented, which requires all communicating nodes to support the ASCII character set; second Second, the PPP protocol is a simplified version of HDLC:

(1) The delimiters at the beginning and end of the frame are the same as the HDLC protocol (00111111),

(2) The address field retains 8 bit (8 1s), which does not require an address (the application environment is two segments corresponding to one link, no address is required)

(3) Control field (unsequenced frame)

(4) Protocol field: Which application process will be pointed to for processing after the processing is completed (IP/IPX...)

(5) Payload field: The default is 1500 bytes (6) Checksum field: 2 or 4 bytes

The above is the detailed content of How to analyze data link protocols HDLC and PPP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete