网络层主要是IP协议。但是
其他一些辅助进行包转发、路由和包安全的协议也算入了网络层。例如ICMP,EIGRP等
ICMP is the Internet Control Message Protocol.
ICMP is a complementary protocol to IP (Internet Protocol). Like IP, ICMP resides on the Network Layer of the OSI Model.
ICMP is designed for sending control and test messages across IP networks.
Unlike the Transport Layer protocols TCP(Transmission Control Protocol) and UDP(User Datagram Protocol) which operate on top of IP, ICMP exists alongside IP.
The ability to understand ICMP is a requirement for any IP-compatible network device. However, many security devices such as firewalls block or disable all or part of ICMP functionality for security purposes.
ICMP Message Types
ICMP operates by sending and receiving a limited number of messages types. The ICMP message types are defined in IANA ICMP Type Numbers.
The most common ICMP message types are:
ICMP Echo Request and Echo Reply
The two most important ICMP messages are Echo Request (8) and Echo Reply (0).
Echo Request and Echo Reply are utilized by the `ping` command to test network connectivity.
Here we use the `ping` command to send three 64-byte ICMP Echo Request messages to www.freebsd.org and receive three Echo Reply messages in response:
This output tells us that network connectivity to www.freebsd.org is working. It also tells us the time each packet took to return.
`ping` is an extremely useful tool for network troubleshooting.
Additional Reading on ICMP
ICMP is defined in RFC 792: Internet Control Message Protocol.