In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
First of all, the explanation of the theory:
The network layer is the third layer of the OSI reference model, between the transport layer and the data link layer. It further manages the data communication in the network on the function of transmitting data frames between two adjacent endpoints provided by the data link layer, and transmits data from the source to the destination through several intermediate nodes, thus providing the most basic end-to-end data transmission service to the transport layer. The main contents include: virtual circuit packet switching and Datagram packet switching, routing algorithm, congestion control method, X.25 protocol, integrated service data network (ISDN), asynchronous transfer mode (ATM) and internetwork interconnection principle and implementation. Next, I will divide it into the following four more important parts to share with my friends:
IP packet format ICMP Protocol introduction ARP Protocol introduction to ARP attack principle
Functions of the network layer:
The purpose of the network layer is to achieve transparent data transmission between the two end systems, including addressing and routing, connection establishment, maintenance and termination, and so on. It provides services so that the transport layer does not need to know about data transmission and switching technologies in the network. If you want to remember the network layer with as few words as possible, it is "routing, routing and logical addressing". To sum up, ah, it is divided into the following three points:
A logical address based on IP protocol is established to connect different media types to select the best path for data to pass through the network.
1. Format of IP packets:
Let's analyze the contents of each item in the table in detail:
1. Version (4); IPv4, IPv6
two。 Header length (4): the length of the header format (excluding upper layer valid data)
3. Priority and type of service (8): packet priority (for example, if we open QQ chat to send messages when we use Xunlei movie without packet priority, then the message you send will not be sent until Xunlei finishes the movie)
4. Total length (16): the length of the head and the length of the upper effective data
5. Identifier (16): the tag for each segment of the packet
6. Flag (3): are there any other segments to follow?
7. Segment offset (13): required for reassembly at the destination
8.TTL (8): lifecycle, which represents how many routes this packet can go through
9. Protocol number (8): describe upper layer protocols, TCP (6), UDP (17)
10. First checksum (16): error check
11. Source address (32): source IP (2 to the 32, 4.2 billion)
twelve。 Destination address (32): destination IP
twelve。 Optional: expand content
13. Data: upper layer valid data
II. ICMP protocol:
First of all, we need to understand that ICMP is the Internet control message protocol. It is a subprotocol of the TCP/IP protocol suite, which is used to transmit control messages between IP hosts and routers. The control message refers to the message of the network itself, such as whether the network is unreachable, whether the host is reachable, whether the route is available, and so on. Although these control messages do not transmit user data, they play an important role in the transmission of user data. Here we summarize the following three points:
1.ICMP is an "error detection and feedback mechanism"
two。 Encapsulated by IP packets
3. Used to send error and control messages
3. Encapsulation of ICMP protocol:
1.ICMP protocol belongs to network layer protocol.
The encapsulation process of 2.ICMP data is shown in the following figure:
The basic format of the 1.Ping command is as follows:
The 2.Ping command returns the following three messages: (here, Microsoft system usually sends four packets, and if packet loss occurs, the network is unstable.)
Reply after ① connection
② cannot access the target host
③ did not receive the reply message returned within the specified time, indicating that the request timed out
The parameters of the Ping command:
The parameter ①:-t will execute ping all the time:
1. Application when debugging failures or conducting continuous connectivity testing
two。 Press Ctrl+C to interrupt the command
The ③:-I parameter sets the size of the ping package:
1. Units in bytes can be used to simply test the quality of communication.
two。 Can be used to simply test the quality of communication.
The parameter ④:-n can set the number of ping packets (normally, the default number of packets sent is four. After setting this parameter, you can change the number of packets sent)
III. Overview of ARP protocol:
1. Communication between hosts in a LAN:
① IP address and MAC address
two。 What is ARP protocol?
① Address Resolution Protocol (address Resolution Protocol)
② resolves a known IP address to an MAC address
Description: ARP protocol is a broadcast type.
Let's use the diagram to explain how to resolve IP addresses to MAC addresses:
The specific steps are:
PC1 sends data to PC2, check cache MAC address without PC2 PC1 sends ARP request message (broadcast) all hosts receive ARP request message (where PC2 replies with ARP reply to implement unicast communication, other hosts ignore this broadcast message because of MAC address mismatch)
The ARP command in the Windows system:
ARP-A: view ARP cache table ARP-D: clear ARP cache ARP-S IP MAC: bind ARP
Next, let's take a look at the ARP commands in Cisco Systems:
IV. ARP attack principle:
1. Deceive all other computers
two。 Deceive a computer that has been attack
ARP spoofing gateway: the figure is as follows
ARP deceives the host: the figure is as follows
All of the above is an introduction to the protocols of the network layer.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.