Typical link layer protocol (brief description)

link layer

Ethernet protocol, ARP protocol ;

The link layer is responsible for data forwarding between adjacent data;

Ethernet protocol:

Used to describe adjacent device communication;

Protocol format:

48-bit peer & source MAC address : describes the physical hardware device designated by the adjacent Liangge;

16-bit upper layer protocol : describes the protocol used by the data in the Ethernet frame, and is used for protocol selection during data sharing;

data ;

32-bit data frame bit : contains the checksum;

MAC address : It is the physical hardware address, which is the address set by each network card when it comes out of the field, and it is fixed and cannot be modified in the early stage;

ARP protocol:

A protocol between the link layer and the network layer , which can obtain the MAC address of the specified device through the IP address ;

method of obtaining:

①Broadcast ARP request , set the destination IP address to all 1s (broadcast address), including its own IP and MAC address, and the IP address of the specified device;

②The host that receives the ARP request will verify whether the target IP address is consistent with itself , if it is not consistent, it will be discarded, and if it is consistent, it will organize the ARP response to fill in its own MAC address to reply;

ARP spoofing

However, the host continues to send a large number of arp responses to all hosts in the LAN, pretending to be a gateway device;

PERSON

The maximum transmission unit limited by the link layer , the default bit of Ethernet is 1500;

Impact on upper layer protocols:

TCP:

In the three-way handshake phase, the two parties will negotiate MSS (maximum data segment size), and take the smaller one as the actual maximum transmission size;

MSS — the maximum data segment size, which is calculated according to the MTU;

MSS = MTU - minimum IP header size - minimum TCP header size;

UDP:

There is no MSS negotiation, as long as the data size is less than 64K after encapsulating the header, it can be sent, but if it is larger than the MTU after encapsulating the IP header at the network layer, it will be fragmented;

However, if fragments are lost during transmission, reassembly will fail, and the entire message will be discarded, which poses a greater risk ;

Therefore, the security of TCP communication is relatively high. If the data is too large during UDP communication, it is necessary to do a good job of subcontracting at the application layer to reduce fragmentation;

Guess you like

Origin blog.csdn.net/SFDWU3QVG/article/details/126876062