Data link layer standards

Source: Internet
Author: User


Data link layer standard data link layer term channel two channels: point-to-point channel: Communication Mode: one-to-one point-to-point communication mode PPP protocol: frame header: requirements to be met:
Simple (this is the first requirement)
Encapsulated into frames
Transparency
Multiple network layer protocols
Multiple types of links
Error Detection
Detect connection status
Maximum transfer unit
Network Layer address negotiation
Features not required for data compression negotiation:
Error Correction
Traffic Control
Serial number
Multi-point line
Three Components of a half duplex or ticket link:
A Method of encapsulating IP datagram into a serial link.
Link Control Protocol (LCP ).
Network Control Protocol (NCP). PPP Protocol working status: transparent transmission problem: character filling:
Convert each 0x7E in the information field into a 2-byte sequence (0x7D, 0x5E ).
If a 0x7D byte appears in the information field, convert it into a 2-byte sequence (0x7D, 0x5D ).
If the ASCII control character (that is, the value is less than 0x20) is displayed in the information field, a 0x7D byte must be added before the character and the encoding of the character must be changed. zero bit filling: method:
When sending, as long as there are 5 consecutive 1. Enter a 0 immediately
When accepted, the bitstream in the frame is scanned. when five consecutive 1 s are found, delete the 0 s after these 5 consecutive 1 S. Note: When PPP is used on the SONET/SDH link, use synchronous transmission (a series of BITs for continuous transmission ). in this case, the PPP protocol uses the zero-bit padding method to implement transparent transmission of broadcast channels. Communication Mode: one-to-many broadcast communication mode. Note: therefore, dedicated shared channel protocols must be used to coordinate the data sending channels of these hosts: static divided channels:
Frequency Division Multiplexing
Time division multiplexing
Wavelength Division Multiplexing
Code Division Multiplexing
Dynamic Channel Division:
Dynamic Media Access Control (Multi-Point Access), Random Access
Dynamic Media Access Control (Multi-Point Access). The controlled access link defines a link as a passive point-to-point physical line segment without any other data link) in addition to physical lines, there must also be a communication protocol to control the transmission of the data. adding hardware and software implementing these protocols to the link constitutes a data link. three basic problems are encapsulated into frames: The first and the end of a piece of data are added respectively, and then a frame is formed. determining frame boundaries transparent transmission: Definition: transparent transmission of data during transmission:
The data link layer of the sender inserts an escape character "ESC" before the control character "SOH" or "EOT" in the data (the hexadecimal code is 1B ).
Byte stuffing or character stuffing the data link layer of the receiver deletes the inserted escape characters before sending the data to the network layer.
If the escape character also contains data, insert an escape character before the escape character. when the receiving end receives two consecutive escape characters, it deletes the previous error control: Cyclic Redundancy test.
The two important measures of frame inspection sequence (FCS) adopt a flexible and connectionless working method, that is, data transmission can be directly sent over Ethernet without serial numbers without establishing a connection, it does not require the other party to send back the confirmation CSMA/CD Protocol definition: Carrier monitoring Multi-Point Access/collision detection CSMA/CD conflict: Conflict controlled: Conflict contention: Practice: Step 1, listen and then send (each station must first check whether other computers are sending data on the bus before sending data)
Step 2: Send while listening (each site must check whether a collision is sent when sending data)
Step 3: stop the conflict (when a collision occurs, both parties must immediately stop sending data and send human interference signals)
Step 4: Random resend (then resend data based on the backoff algorithm) Propagation latency for carrier listening: human interference signal:
Features: It is impossible for a site to send and receive data simultaneously.
The multi-computer is connected to a bus through multi-point access. The backoff algorithm is used to determine the basic backoff time. Generally, the backoff time is equivalent to the competition period (2 ).
Define retransmission times k, k = Min [retransmission times, 10]. From the Integer Set ,..., (2 to the power of the K-1 minus 1)] a random number is taken as r. The retransmission latency is r times the backoff time
This frame is discarded when the re-transmission fails for 16 times, and the contention period is reported to the higher level: the time when the sender transmits data to the receiver, and the receiver returns the data to the sender
Ethernet takes 51.2 s as the length of the contention period. During the contention period, 512 bits can be sent, that is, 64 bytes. if no conflict occurs between the first 64 bytes of data that can be sent during the competition period, the subsequent data will not conflict. If the received frame is smaller than 64 bytes, the CSMA/CD sending process will be directly discarded: CSMA/CD receiving process:
Services provided by Ethernet the services provided by Ethernet are unreliable delivery, that is, the best effort for delivery. this frame is discarded when the target station receives a data frame with an error and does nothing else. the correction of errors is determined by the top management. if some data is lost and retransmitted at the higher level, Ethernet does not know that this is a re-transmitted frame, but is sent as a new data frame. MAC frame format: value of the MAC frame type Field and Its Meaning: 0x0000-0x05DC IEEE 802.3 Length
0x0101-0x01FF Experiment
0x0600 XEROX NS IDP
Zero x 0660
0x0661 DLOG
0x0800 Internet Protocol (IP)
0x0801 X.75 Internet
0x0802 NBS Internet
0x0803 ECMA Internet
0x0804 Chaosnet
0x0805 X.25 Level 3
0x0806 Address Resolution Protocol (ARP: Address Resolution Protocol)
0x0808 Frame Relay ARP (Frame Relay ARP) [RFC1701]
0x6559 Raw Frame Relay [RFC1701]
0x8035 Dynamic DARP (DRARP: Dynamic RARP) Reverse Address Resolution Protocol (RARP: Reverse Address Resolution Protocol)
0x8037 Novell Netware IPX
0x809B EtherTalk
0x80D5 ibm sna Services over Ethernet
0x80F3 AppleTalk Address parsing Protocol (AARP: AppleTalk Address Resolution Protocol)
0x8100 Ethernet Automatic Protection switch (EAPS: Ethernet Automatic Protection Switching)
0x8137 Internet Packet Exchange (IPX: Internet Packet Exchange)
0x814C Simple Network Management Protocol (SNMP: Simple Network Management Protocol)
0x86DD Internet Protocol v6 (IPv6, Internet Protocol version 6)
0x880B Point-to-Point Protocol (PPP: Point-to-Point Protocol)
0x880C Common Exchange Management Protocol (GSMP: General Switch Management Protocol)
0x8847 Multi-Protocol Label Switching (unicast) MPLS: Multi-Protocol Label Switching <unicast>)
0x8848 Multi-Protocol Label Switching (multicast) (MPLS, Multi-Protocol Label Switching <multicast>)
0x8863 PPP Over Ethernet (Discovery phase) (PPPoE: PPP Over Ethernet <Discovery Stage>)
0x8864 PPP Over Ethernet (PPP Session phase) (PPPoE, PPP Over Ethernet <PPP Session Stage>)
0x88BB Lightweight Access Point Protocol (LWAPP: Light Weight Access Point Protocol)
0x88CC connection Layer Discovery Protocol (LLDP: Link Layer Discovery Protocol)
EAP (EAPOL: EAP over LAN) on 0x8E88 LAN)
0x9000 configure the test protocol (Loopback)
0x9100 VLAN Tag Protocol Identifier (VLAN Tag Protocol Identifier)
0x9200 VLAN Tag Protocol Identifier (VLAN Tag Protocol Identifier)
0 xFFFF reserved Mac Address Allocation: IEEE's registration authority RA is responsible for allocating the first three bytes of the address field to the manufacturer (that is, the last 24 bytes)
The last three bytes in the address field (that is, the lowest 24 bits) are assigned by the manufacturer. They are called extended identifiers and must ensure that the generated adapter has no duplicate addresses. The hardware address is also called a physical address, or MAC address MAC frame: unicast (unicast) frame (one-to-one)
Broadcast (broadcast) frame (one to all)
Multicasting frame (one-to-multiple)
The Ethernet adapter can also be set as a special mode, a hybrid paradigm. When working, as long as you hear a frame transmitted over the Ethernet, the two standards are quietly received: DIX Ethernet V2 standard (the most common MAC frame format is Ethernet V2)
Invalid MAC frame of IEEE 802.3 standard: the length of the data field is inconsistent with the value of the length field.
The frame length is not an integer byte.
An error is detected using the received frame inspection sequence (FCS ).
The length of the data field is not 46 ~ Minimum interval between frames of 1500 Bytes: defined as: the minimum interval between frames is 9.6 s, which is equivalent to 96-bit sending time.
Purpose: To send data again after a station detects that the bus is idle for 9.6 seconds. this is done so that the receiving cache of the station that has just received the data frame can be cleared up, and the preparation for receiving the next frame is required. Expand the LAN in the physical layer (expand the LAN with the hub) Advantages: so that computers in the LAN belonging to different collision domains can communicate across collision domains. Disadvantages: the collision domains increase, but the total throughput has not increased.
If different collision domains use different data rates, they cannot be connected by a hub at the data link layer to expand the LAN (by using a bridge to expand the LAN). Advantages: expands the geographical coverage of the LAN
Filter traffic
Extended physical scope
Improved reliability
Lan that can interconnect different physical layers, different MAC Sub-layers, and different rates (such as 10 Mb/s and 100 Mb/s Ethernet)
The disadvantages of bridging network segments into isolated collision domains: storage forwarding increases latency.
There is no traffic control function on the MAC Sub-layer.
When network segments with different MAC Sub-layers are bridging together, the latency is greater.
The bridge is only suitable for LAN with fewer users (no more than several hundred) and less traffic. Otherwise, network congestion may occur due to the spread of too much broadcast information. this is the difference between the so-called broadcast storm physical layer and the LAN extension on the data link layer: When the hub forwards frames, it does not detect the transmission media.
The bridge must execute the CSMA/CD algorithm before forwarding frames. If a collision occurs during the sending process, it must stop sending and backoff the computer from communicating with the LAN through the adapter.
The Hub bridge Forwarding Table registers the following information: Source Address
Interface number
Time transparent bridge self-learning algorithm: process received data frames:

Requirement: update the forwarding table spanning tree algorithm at intervals: method:
After the interconnected bridges communicate with each other, they can find a subset of the original network topology. in this subset, there is no loop in the connected network, that is, there is only one path between any two stations.
To obtain the Spanning Tree that reflects the changes in the network topology, the root bridge on the spanning tree must update the topology of the spanning tree at intervals.
Purpose:
In order to avoid generating forwarding frames in the network, the source routing Bridge is constantly used. Objective:
Find the optimal route path
Method:
The Origin Site sends a discovery frame to the target site in broadcast mode, each of which records the route
When a frame arrives at the destination site, it is returned to the origin site along its route
After the source station learns these routes, it selects an optimal route from all possible routes.
Any frame header sent from the origin site to the destination site must carry the star topology of the information network topology determined by the Origin Site: because the emergence of hubs and twisted pair wires are widely used in Lan, this topology is widely used in ring topology: In the logical ring topology, each node receives frames in sequence. if the frame is not sent to this node, it will pass the frame to the next node. this will allow the ring to use a controlled media access control technology called token Transfer
The node in the logical ring topology removes the frame from the ring and checks the address. If it is not sent to the node, it is sent back to the ring.
In the cycle, all nodes in the cycle between the source node and the target node will check the topology of the frame bus, so that multiple nodes can communicate with each other by using the same shared media.
Only one terminal sends data at a time.
Each node can view all frames on the media, but only the target node of the frame can process the frame content.
The media access control method used is generally CSMA/CD or CSMA/CA point-to-point topology. The point-to-point topology connects two nodes directly.
A virtual circuit is a logical connection between two network devices in a network. A switch-type hub is often called an Ethernet switch or a layer-2 switch (indicating that the switch works on the data link layer) ethernet switches usually have more than a dozen interfaces. therefore, an Ethernet switch is essentially a multi-interface bridge, it can be seen that the vswitch works on the data link layer. The virtual lan vlan consists of some lan cidr blocks and has a clear identifier for each VLA frame in a logic group unrelated to the physical location, specifies the VLAN of the workstation that sends this frame. The ethernet switch is used to implement the virtual LAN. These network segments share some common requirements. The Ethernet frame used by the virtual LAN sends an average time LAN for one frame. wireless protocol
LAN Ethernet protocol WAN Point-to-Point Protocol PPPOE protocol preface PPPOE (PPP over Ethernet, RFC2516, it is worth noting that this RFC is not Standard but Information type) defines how to transmit PPP data packets over Ethernet.
ADSL is implemented through PPPoE. communication Process Overview The establishment of PPPOE channel (ADSL dialing) is divided into two phases: discovery phase and PPP session phase. in the discovery phase, an Access Concentrator (AC and Access Concentrator) on an Ethernet client is called the adsl modem. Generally, there is only one AC at home; however, if there may be more than one ADSL in an Ethernet, there will be more than one AC, then the client will select one. after the discovery phase is complete, both the client and the AC obtain information about the PPP channel to be established on the Ethernet. the discovery phase is stateless, that is, the two sides do not need to save the previous status information. Only after the PPP session starts, the two sides need to establish a virtual PPP communication interface, the ppp0 Nic is available in Linux, and the ADSL interface is added to the network connection in windows. the Protocol Header Format protocol value PPPOE data is directly above the Ethernet header data, and its level is the same as ARP, IP, and so on. In the Ethernet header type field, 0x8863 indicates the PPPOE discovery phase data, and 0x8864 indicates the PPP session phase data, as shown below. (analogy: 0x0800 indicates IP data, and 0x0806 indicates ARP data.) The PPPOE header has 6 bytes, Which is exactly 4-byte aligned with the 14-byte Ethernet header, contains the following fields: VER version number, 4 bits, must be 0x01
TYPE, 4 bits, must be 0x01
CODE: 8-bit, which has different definitions in the discovery phase and PPP session phase
SESSION_ID session ID: 16 bits are used to define a PPP Session, which is defined during the discovery process.
LENGTH: 16 bits, indicating the Load LENGTH, excluding Ethernet and PPPOE headers. the data in the PPPOE discovery phase is 0x8863. in the discovery phase, the TAG is used to exchange the client and AC information, establish a PPPOE channel, and the load information is PPPOE information without the upper-layer protocol data.
The load in the discovery phase is called a TAG. The TAG information format is as follows. The load information may contain multiple tags: TAG_TYPE: 16 bits, TAG type (TAG_TYPE can take the following values (note that the first byte is 2 indicates an error message) 0x0000 End-Of-List
0x0101 Service-Name
0x0102 AC-Name
0x0103 Host-Uniq
0x0104 AC-Cookie
0x0105 Vendor-Specific
0x0110 Relay-Session-Id
0x0201 Service-Name-Error
0x0202 AC-System-Error
0x0203 Generic-ErrorTAG_LENGTH: 16 bits, indicating the length of TAG_VALUE part TAG_VALUE: TAG value PPPOE Active Discovery initial package (PADI) by the client, the destination address in the Ethernet header is the ethereum broadcast address FF: FF. The CODE in the PPPOE header is 0x09, And the SESSION_ID value must be 0, the load part must contain only one Service-Name TAG to indicate the requested Service type. In addition, it can contain other tags. The entire PPPOE package cannot exceed 1484 bytes, in this way, the 16-byte relay TAG can be added by the ADSL relay device.
An example of a PADI package is: PPPOE Active Discovery proposal package (PADO) is sent by the AC to respond to the PADI package of the client, the destination address in the Ethernet header is the MAC address of the client. The CODE in the PPPOE header is 0x07, the SESSION_ID value must be 0, and the load part must contain an AC-Name TAG, indicates the Name of the AC. A Service-Name TAG specified in the PADI package can also contain tags of other Service-names. if the AC does not provide services to the client, the AC will not respond to the PADO package. an example of a PADO package is: The PPPOE Active Discovery Request packet (PPPOE Active Discovery Request, PADR) is sent by the client, because multiple AC may respond to the PADO package sent by the client, the client selects an AC from the PADO package to send the PADR package, the destination address in the Ethernet header is the MAC address of the AC. The CODE in the PPPOE header is 0x19, and the SESSION_ID value must be 0, the load part must contain only one Service-Name TAG to indicate the requested Service type. It can also contain other tags. PPPOE actively discovers the Session Validation Package (PPPoE Active Discovery Session-confirmation, PADS) sent by the AC. After receiving the client's PADR package, AC will generate a SEESSION_ID value to mark this PPP session and send it to the client as a PADR package. the destination address in the Ethernet header is the MAC address of the client. The CODE in the PPPOE header is 0x65, and the SESSION_ID value must be the generated SESSION_ID, the load part must contain only one Service-Name TAG, indicating that the Service type is accepted by the AC. It can also contain other tags. if the AC does not accept Server-Name in PADR, PADS contains a Service-Name-Error TAG, and SESSION_ID is set to 0. PPPOE Active Discovery stop package (PPPoE Active Discovery Terminate, PADT) indicates the end of The PPPOE session process, both the AC and the client can actively send. the destination address in the Ethernet header is the MAC address of the Peer party. The CODE in the PPPOE header is 0xa7, And the SESSION_ID value must be the SESSION_ID of the pppoe session process. No TAG is required. in the PPP session phase, the PPP package is encapsulated in the PPPOE Ethernet frame. The destination address of the Ethernet packet is single, the Ethernet protocol is 0x8864, And the PPPOE header CODE must be 0, SESSION_ID must always be the SEESION_ID value negotiated during the discovery phase. The load of PPPOE is the entire PPP package, and the first two bytes are the PPP protocol ID values.
An example of a PPPOE session package is as follows:

Note: Since the PPPOE header is 6 bytes and the PPP protocol idcode occupies 8 bytes in total, while the MTU value of Ethernet is 1500, the upper-layer PPP load data cannot exceed 1492 bytes, therefore, the maximum number of receiving unit values negotiated during PPP negotiation cannot exceed 1492 bytes, that is, the MTU in the PPPOE environment is 1492 bytes. in the ADSL dialing process, the client starts the dialing program, sends the PADI package, the adsl modem responds to the PADO package, the client sends the PADR package again, and the adsl modem responds to the PADS package and establishes the PPPOE channel, then the client performs the common PPP protocol dialing process, but the PPP data packets are packaged into the Ethernet frame. After successful dialing, the client and the server establish a PPP channel, adsl modem converts an Ethernet frame to a PPP package. although ADSL uses telephone lines, the frequency is not the call frequency. Therefore, dialing ADSL does not affect the call. after the communication ends, the PADT will be sent to disconnect the PPPOE channel.
Conclusion
Because of the wide application of ADSL, PPPOE is also applied. Understanding the communication protocol and data format is necessary for the development, protocol analysis, and access control of the underlying driver, PPPOE is supported in both windows and linux.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.