Principles of Computer Networks fourth chapter succinctly - the network layer

4.1 Basic Concepts

4.2 Services provided by the network layer


Responsible for trying to forward packets between different networks based on IP address of the packet forwarding is not responsible for lost retransmission packet is not responsible for order

4.3 How to network layer forwarding packets

The transmitting end
1, the application is ready to transfer a file
2, file transport layer segments and number
3, add the destination IP address of the network layer, the source IP address
4, the data link layer is divided two cases, one using its own child network masks to determine which of its own network segment; the other uses its own subnet mask determine which network segment destination address in; if it is the same network segment, on the use of the ARP protocol broadcast to resolve the MAC address of the destination IP address; if not the same network segment, the data is sent to the gateway, router to choose the next hop until it reaches the target address

4.4 OSI reference model and the network device

Process computer communication process, communication and local network segment to communicate across network segments

4.5 Network layer protocol

4.5.1 IP protocols RIP OSPF

4.5.2 ARP protocol

The IP broadcast address, the destination MAC address is FF-FF-FF-FF-FF-FF, resolve the destination IP address of the MAC address, the broadcast can not be routed across

4.5.3 Internet Control Message Protocol ICMP

Learn ICMP ping command

4.5.4 Internet Group Management Protocol IGMP

Internet Group Management Protocol (English: Internet Group Management Protocol, abbreviation: IGMP) is a protocol used to manage network communication protocol multicast group members. IP hosts and adjacent routers use IGMP group members to create a multicast group. Like ICMP for unicast connections, like, IGMP IP Multicast is an integral part of the broadcast description. IGMP is an Internet Protocol, is an open system link (OSI) Layer protocol modules, IP multicasting routers send host membership report to close it with a multi-host

4.6 ipv4 IP packet format (focus)


Data from the transport layer portion of

the figure, a line representative of 32 bits, is equal to 4 bytes, a total of five rows fixing portions, a total of 20 bytes in
each field have the following meanings

版本:用来表示TCP/IP协议的版本,例如ipv4、ipv6
首部长度:规定首部的长度
区分服务:区分不同的流量进行排队(QOS),十六进制表示
总长度:16个比特表示,一个数据包最大可用2的16次方减1对于65535个字节表示
标识:用于给网络层数据包分片标识,根据标识组装成完整的数据包
标志:标志(flag)占3位比特,用于表示数据包是完整的还是其中一个分片。目前只有前两位有意义,标志字段的最低位是MF(More Fragment)。MF=1表示后面"还有分片"。MF=0表示最后一个分片。标志字段中间一位是DF(Don't Fragment)。只有当DF=0时才允许分片。当数据包不分片时,这3位是 "010" 表示
片偏移:记录分片后每个数据包的第一个字节占完整数据包的第多少个字节(从0计算),再除以8表示
生存时间:在IP数据包中,用来表示数据包的生存时间,每经过一个路由器,生存时间减一;Linux下默认64,window128,Unix默认255
协议:用来表示数据部分的数据是属于什么协议的,常见的协议号十进制表示的有ICMP协议1,IGMP协议2,TCP协议6,UDP协议17,ipv6协议41,OSPF协议89
首部校验和:接收端用此来校验数据包的正确性,最后计算结果为0,则保留数据包,否则认为数据包在传输过程中被修改了,丢弃数据报
源地址:源ip地址
目的地址:目标ip地址
可选字段(长度可变):用于一些自定义设计,在ipv6格式的数据包中已取消
填充:当可选部分不够位数时,用来填充的部分
数据部分:如果不分片,数据包的数据最大不超过1480字节

4.7 IP协议

引自wiki:网际协议(英语:Internet Protocol,缩写:IP;也称互联网协议)是用于分组交换数据网络的一种协议。IP是在TCP/IP协议族中网络层的主要协议,任务仅仅是根据源主机和目的主机的地址来传送数据。为此目的,IP定义了寻址方法和数据报的封装结构

Guess you like

Origin www.cnblogs.com/AutoSmart/p/11005415.html