关于计算机网络的知识点很多,这篇对于常见的五层模型做一个梳理,附上我认为还详细不错的参考链接(因为相关内容挺多挺全的,直接指路最快了), 算是自己的学习指南。
A network is made up of several computers connected. They can be connected through different protocols. A Protocol is a set of rules that allow two computers in a network to send and receive information. That set of rules is essential to understand what information is coming from what source, or how to send information to a particular computer in the network.
The networks we commonly use today, are broken down into different layers. This design by layers assigns responsibilities to each layer to accomplish something. It is good to have a design by layers for several reasons. For example, if network engineers want to make a change in one of the layers, the impact on the other layers is minimized. Another example is that if you are a programmer and want to connect your application to a server, you do not necessarily need to care if the user is using wifi or ethernet cable, or how the user is connected to the internet. Your application can trust other layers are going to take care of that and your application will have a successful connection. These are the layers, viewed in a top-down approach.
Application layer(应用层): Responsible for handling data traffic between applications. HTTP belongs to this layer; HTTP protocol is commonly used to obtain Web Pages.
Related Protocols: DNS, FTP, Telnet, HTTP, SMTP, DHCP
应用层的重点有DNS,HTTP和FTP,可以参考:
应用层(一)_猿小羽的博客-CSDN博客_应用层
Transport layer(传输层): Responsible for providing several connections on the same host, which means that you can have several applications on the same device and each of them can have a different connection even if it is just one device. It also defines functionalities for reliable transport. Two protocols are used on this layer. TCP (Transport Control Protocol). You use this protocol when you need to have reliable transport, this makes sure that if a piece of information was missing while being transferred it is resent. HTTP from the Application layer runs on top of TCP because when you visit a Web Page you want to have every part of it accurately. On the other hand, when you don’t need reliable transport, but you want faster transport that does not resend missing parts, UDP (User Datagram Protocol) is used. An example of when UDP is needed is for voice communication. When you are talking if a little part of the audio is missing, you do not want it to appear later in the communication because that would confuse the listener. The listener can still understand what you are saying if the part missing is small enough. Since UDP has no controls for transport, it is faster than TCP.
This layer assigns a port to each connection, and that is how it tells the difference between connections in the same computer, because of the port.
Related Protocols: TCP, UDP
传输层其实考察最多的主要就是TCP和UDP这两个协议,包括“三次握手”和“四次挥手”等,提供一个参考链接:网络——传输层(详细版)_小 乔的博客-CSDN博客_传输层
Network layer(网络层): It provides devices with an address in the network called the IP (Internet Protocol) address, and routes information through different routers. It provides a mapping between all the computers connected to the internet. When you connect to a network in some specific place, an IP is assigned to your device.
Related Protocols: ARP, IP, ICMP, IGMP
关于网络层一个很详细的整理,内容比较多,重点是对ip地址的划分等:
计算机网络——网络层_疯狂嘎嘎的博客-CSDN博客_网络层
Data link layer(数据链路层):
数据链路层是在通信的实体间建立数据链路链接。
It provides communication between devices that are connected directly. Examples of protocols in the data link layer are Ethernet or WiFi. You generally use WiFi to send messages to your router directly without any other devices in between. Each device has a physical address in WiFi or ethernet, known as the mac address. The mac address is used for this layer. This is not an address like the IP that can change depending on the network you are connected to. The mac address is assigned to the hardware of your network card when it is manufactured.
Related Protocols: PPP, Ethernet, HDLC
关于数据链路层,重点主要有封装成帧、差错检测以及相关的协议,可以参考:数据链路层简介_小涵子要努力呀的博客-CSDN博客_数据链路层
(上面链接文章中的提到的ARP协议在本篇是归到了网络层,因为ARP协议在不同划分标准中所位于的层不同,理智参考即可)
Physical layer(物理层): This handles electrical pulses on the wire that represent bits. (物理层主要作用是定义物理设备如何传输数据)。
物理层比较“硬”,有协议但没啥重点值得列的,但还是给个参考链接:
二、物理层详解_猿小许的博客-CSDN博客_物理层
个人感觉不如前几层重要,没空就不看了哈哈。
When you access a browser and visit a website, the information on the website is downloaded in packets. Today’s Internet is fast, and you might feel that the website appears all at once. But if you download a big file, you can see that it takes some time. This happens because the file is broken down into packets that are received in your computer, and begin to accumulate until they are all received and conform to the whole file when the download is completed. Each packet contains a piece corresponding to each layer. By the way in a tool called Wireshark, we can “sniff” the packets transmitted on a network. 以后有机会再记录Wireshark的操作案例,基本上计算机网络实验躲不开这个工具。这篇文章就先到这里~