OSI Seven-layer reference Model-Network layer
Network layer
Carry on the logical address addressing, realize the communication between different networks, define the IP address, choose the best path for data transmission, and the router works in the network layer.
I. IP packet format
Priority and service type (8 bits): priority and service type
Identifier, flag, segment offset: these fields are used to identify the packet, so that when the data reaches the destination, it will not be out of order.
Header length: the minimum length of ip packet header is 20 bytes
Total length (16):
Protocol number: UDP is 17. TCP is 6.
First checksum:
TTL: lifecycle field. When the TTL value of a router is minus 1, when 0, the packet is dropped. To prevent a packet from looping indefinitely in the network.
II. Network layer protocols
1. ARP protocol
Resolve a known IP address to an MAC address
ARP-an in Windows system: view the ARP cache table
2. Agent ARP
IP address resolves to MAC address of gateway interface
3 、 ICMP
Internet Control message Protocol
1) the connection is established successfully:
Reply from 192.168.1.1:bytes=32 time