Computer network reading Notes-----Data Link Layer

Source: Internet
Author: User
Tags control characters

    • First distinguish the concept of link and data link

A link is just a physical line from one node to an adjacent node, with no other switching nodes in the middle. So the link is just a part of the path.
Data Link: It is necessary that the physical circuit and the necessary communication protocols constitute the data link.

Protocol Data Unit ——-frames for the data link layer
Similar to the Network Layer Protocol data unit is the IP datagram

The router's protocol stack is only three layers: Network layer, link layer, physical layer
The task of the data link layer is to send the data from the network layer to the link, and to take the data from the received frame to the network layer.


When two host communication: The application process from the application layer down through the layer, through the transport layer to the network layer, the network layer will be composed of data IP datagram, upload to the data link layer, the Data link layer is encapsulated into a frame to the physical layer, the physical layer after the formation of a bit stream into the communication network.
Through the router, each router's physical layer after receiving the bitstream, first by the data link layer to restore the bitstream into a frame, then extract the IP datagram from the frame, in the routing table to find the next hop address, the router forwards the IP data, and then package it into another new frame, and then to the physical layer sent to the next router. In this way, after the forwarding of many routers, the data finally arrives at the physical layer of the destination host, and then to the remote application process by layer to upload.

Three basic problems: frame delimitation, transparent transmission, error detection.
Frame delimitation: Refers to a frame header and tail are added to the tag, so that the receiver can recognize the beginning and end of the frame, and the frame inside the data part of the exact location.
Upper length of the data portion of the intermediate frame--MTU (maximum transfer unit)
Transparent transfer: The start and end identities of the frames are the names of the control characters, Soh and EOT, hex codes 01 and 04, but when the binary code in transit is exactly the same as these two, the boundary of the frame is incorrectly found


It is wrong to think that the front is a frame, and because the start tag cannot be found later, it will be discarded later.
In order to resolve the transparent transfer, it is necessary to convert the possible control characters Soh and EOT in the data to another character, which is not interpreted as a control character. called byte insertion.

control characters that appear in the data characters sent after a byte has been inserted
SOH Escx
EOT Escy
Esc Escz

  
At the receiving end, as long as the corresponding inverse transformation can be very convenient to restore the original data, using this byte insertion method to achieve transparent transmission.
Error detection:
BITS may cause errors during transmission, so cyclic redundancy test CRC technology is widely used in the data Link transport layer, but CRC can only be accepted without error (excluding discarded frames).
Transmission to the receiving end of the frame error-free, no loss, no duplication, but also in the order of delivery received, must be added confirmation and retransmission mechanism.

    • The point-to-Point protocol PPP is a more protocol used in the data link layer.

The composition of the PPP protocol:
The method of encapsulating an IP datagram to a serial line, where the IP datagram is the information part of the PPP frame.
Link Control protocol used to establish the configuration and test Data Link connection LCP (some options for both sides of the communication negotiable)
A set of network control Protocol NCP, in which each protocol supports different network layer protocols.

Internet service Provider ISP is a user to provide dial-up access to the operating institutions, the ISP router and the Internet through high-speed leased line connected, and the telecommunications company's local switch also has a dedicated line connected.

Working status of PPP protocol:
When the user dials in to the ISP, a physical connection is established from the user's PC to the ISP, when the user PC sends a series of LCP packets (encapsulated into multiple PPP frames) to the ISP's router. These groupings and responses select some of the PPP parameters that will be used, then network configuration, the NCP assigns a temporary IP address to the newly accessed user PC, so that the user PC becomes a host on the Internet. When the communication is complete, the NCP frees the network layer connection to reclaim the original assigned IP address, and the LCP releases the data link layer connection. Finally, the connection to the physical layer is released.

When a user's PC calls the router through a modem, the router detects the carrier signal that the strip is emitting directly from the paint. After the physical layer connection is established, PPP enters the state of the link establishment, which is to establish the LCP connection of the link layer.
At this point LCP begins to negotiate some configuration options, that is, to send a configuration request frame for LCP.
After negotiation, enter the status of identification, if the identity fails, then go to the link termination state, if the authentication is successful, then enter the Network layer protocol status
In the Network Layer protocol state, the network Control Protocol NCP on both ends of the PPP link exchanges network Layer-specific network control groupings based on the different protocols of the network layer. If the IP protocol is running on the PPP link, the IP Protocol module (assigning IP address) is configured on each side of the PPP link to use the Protocol-–ip Control Protocol (IPCP) that supports IP in the NCP.
When the network layer is configured, the link enters the link open state that can be used for data communication. The two PPP endpoints of the link can send each other a grouping.
After the data transfer is over, a termination request can be sent by one end of the link to the LCP packet (terminate-request) request to terminate the link connection, and after receiving the terminating acknowledgment LCP packet (terminate-ack), go to the link termination state.
When the carrier of the modem stops, it returns to the link standstill state.

From
Computer network Fifth edition. Shehiren

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Computer network reading Notes-----Data Link Layer

Related Article

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.