Network knowledge 02: TCP / IP Overview

A DOD model

 

IRI Transmission Control Protocol Internet Protocol (TCP / IP) set by the US Department of Defense (DOD) created, mainly used to ensure data integrity and maintain communications in a devastating war

Protocol suite is a combination of a set of protocols together different functions

Using a set of protocols implemented OSI completion

Two DOD model agreement

Application Layer: Telent (remote login protocol, providing remote management services, port 23), FTP (file transfer protocol, providing Internet resource file sharing service port 20,21), TFTP (Trivial File Transfer Protocol, providing simple file transfer service , UDP protocol, port 69), SNMP, HTTP, SMPT (simple mail transfer protocol, to provide Internet e-mail service, port number 25), POP3 (Post Office protocol, to provide Internet email services), NFS, DHCP

Host-to-host layer: TCP, UDP

Internet layer: responsible for grouping packets sent from the source to the destination

Network Access Layer: Ethernet, FastEth, TokenRing, FDDI

Three TCP / IP protocol

TCP: Transmission Control Protocol, belong to a network connection-oriented protocol, reliable transmission, flow control

Applications use: Web browsers, e-mail, file transfer program

3.1 TCP packet structure

Detailed message

3.2 UDP protocol

User Datagram Protocol, belong to a network protocol connectionless unreliable transport, transfer try

Applications using UDP: Domain Name System DNS; video streaming; IP voice (VoIP)

UDP header

3.3 port numbers

Randomly assigned source port, destination port known port

Application client source port number generally used in the system is not used and greater than 1023

Destination port number for the process server application services such as telent 23

3.4 TCP three-way handshake

Add two hosts are connected, as follows

1. A generates a sequence number 100 is added, to bring the sequence number, sending a request to the B SYN

2. B receives the request, if it is confirmed connected, also uses a sequence number SEQ, if it is 300, will bring its own serial number of SYN request acknowledgment is sent to the other party and the ACK sequence number plus a number of other formed

3. A received a confirmation number and a request B seq connection, it sends an ack acknowledgment number, connection establishment

3.5 connection port number

3.6 window mechanism

窗口机制是一种可靠的机制,加入AB主机进行会话连接,发送数据包,一开始A发了三个数据包,这是B没有处理完成,把数据包3丢弃,同时发送ACK为3,同时发送自己希望发送的的包的大小是2,这时A就会知道B的处理能力,会每次发送2个大小为2的包,连接一直进行

3.7 因特网层机制

负责将分组的报文从源端发到目的端

协议:ICMP,ARP,RARP,IP

网络层的作用:

为数据中的设备提供逻辑地址

负责数据包的寻径和转发

IP报文

ARP协议:

将IPv4地址解析为MAC地址

维护映射的缓存

查询arp的方式:arp -a

最开始没有arp表,会先发送一个广播的请求报文,写有IP,但是MAC地址时所有地址,是一个广播帧,在局域网内都会收到这个广播,非对应IP,不会处理,对应的IP会回应一个回应报文,,就会把MAC地址缓存在ARP表中

arp的一个请求报文

 回应报文

经过一系列arp请求,都会有自己的arp表,并维护

四  VLSM

可变长度的子网掩码

4.1 IP地址

IPv4,32位,点分十进制

路由器只关心网络部份

IP=网络部分+主机部分

通信类型:单播,广播,组播

IP地址类型:

IP=网络部分+主机部分

网络地址:指代网络的地址.在网络的IPv4地址范围内,最小地址保留为网络地址.此地址的主机部分的每个主机均为0.

广播地址:用于向网络中的所有主机发送数据的特殊地址.广播地址使用该网络范围内的最大地址.即主机部分的个比特位全部为1的地址

主机地址:分配给网络中终端设备的地址

4.2 划分子网

掩码的作用:划分网络位和主机位

向主机借位划分

4.3 私有地址

10.0.0.0 to 10.255.255.255(10.0.0.0/8)

172.16.0.0 to 172.31.255.255(172.16.0.0/12)

192.168.0.0 to 192.168.255.255(192.168.0.0/16)

参考连接

公开课视频:https://www.bilibili.com/video/av24400474/?p=3 

Guess you like

Origin www.cnblogs.com/zyxnhr/p/11067438.html