当前位置:网站首页>互联网协议
互联网协议
2022-07-07 09:07:00 【全栈程序员站长】
## 互联网协议 – 概括:从上到下,越上越接近用户,越下越接近硬件 – 应用层: + 规定应用程序的数据格式 + [HEAD(以太网标头) [HEAD(IP标头) [HEAD(TCP标头) DATA(应用层数据包)]]]
– 传输层(端口到端口的通信): 定义端口号 + 端口: * 0到65535(2^16)的整数 * 进程使用网卡的编号 * 通过IP+mac确定主机,只要确定主机+端口(套接字socket),就能进行程序间的通信 + UDP协议: * 数据包中加入端口依赖的新协议 * 数据包[HEAD(发送、接收mac) [HEAD(发送、接收ip) [HEAD(发送、接收端口) DATA]]] * 简单,可靠性差,不知道对方是否接受包 + TCP协议: * 带有确认机制的UDP协议 * 过程复杂,实现困难,消耗资源 “` tcp/ip connect: tcp/ip的三次握手 标有syn的数据包 ————-> 标有syn/ack的数据包 client <————- server 标有ack的数据包 ————–> “`
– 网络层(主机到主机的通信):定义IP “` tcp/ip finish: tcp/ip的四次握手 fin <————- ack client ————-> server fin ————-> ack <————- “`
– 网络层(主机到主机的通信): + IP协议 * ipv4: – 32个二进制位表示,由网络部分和主机部分构成, – 子网掩码: 网络部分都为1,主机部分都为0,目的判断ip的网络部分,如255.255.255.0(11111111.11111111.11111111.00000000) – IP数据包:标头Head+数据Data,放进以太网数据包的Data部分[HEAD [HEAD DATA]] – IP数据包的传递: + 非同一网络:无法获得mac地址,发送数据到网关,网关处理 – ARP(Address Resolation Protocol): 解析地址协议,通过ip解析mac地址 + 同一网络:mac地址填写FF:FF:FF:FF:FF:FF:FF,广播数据,对比ip,不符合丢包
– 链接层:定义mac + 定义数据包(帧Frame) * 标头(Head):数据包的一些说明项, 如发送者、接收者、数据类型 * 数据(Data):数据包的具体内容 * 数据包:[HEAD DATA] + 定义网卡和网卡唯一的mac地址 * 以太网规定接入网络的所有终端都应该具有网卡接口,数据包必须是从一个网卡的mac地址到另一网卡接口的mac地址 * mac全球唯一,16位16位进制组成,前6厂商编号,后6网卡流水号 + 广播发送数据 * 向本网络内的所有设备发送数据包,对比接收者mac地址,不是丢包,是接受
– 实体层:物理层 + 终端(pc,phone,pad…)的物理连接(光缆,电缆,路由…),负责传递0和1信号
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113825.html原文链接:https://javaforall.cn
边栏推荐
- I plan to take part in security work. How about information security engineers and how to prepare for the soft exam?
- 【安装系统】U盘安装系统教程,使用UltraISO制作U盘启动盘
- Deeply understand the characteristics of database transaction isolation
- PostgreSQL中的表复制
- Différences entre les contraintes monotones et anti - monotones
- Mendeley -- a free document management tool that automatically inserts references into papers
- Laya common script commands
- Wallhaven wallpaper desktop version
- Compile QT project script with qmake
- [actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
猜你喜欢

Qtcreator sets multiple qmake

香橙派OrangePi 4 LTS开发板通过Mini PCIE连接SATA硬盘的操作方法

从色情直播到直播电商

【OneNote】无法连接到网络,无法同步问题
![[installation system] U disk installation system tutorial, using UltraISO to make U disk startup disk](/img/41/3a9450a84291ba04caee65241bce5d.png)
[installation system] U disk installation system tutorial, using UltraISO to make U disk startup disk

The use of list and Its Simulation Implementation

Mendeley -- a free document management tool that automatically inserts references into papers

PostgreSQL中的表复制

Arduino board description
![[STM32] actual combat 3.1 - drive 42 stepper motors with STM32 and tb6600 drivers (I)](/img/cd/7cd8e2e77419c65d633a2a235b2362.png)
[STM32] actual combat 3.1 - drive 42 stepper motors with STM32 and tb6600 drivers (I)
随机推荐
Template initial level template
Unity websocket client
The difference between monotonicity constraint and anti monotonicity constraint
Rolling puddle Uni_ App (VIII)
JS implementation chain call
[actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
Cmake learning manual
2022.7.6DAY598
2021-04-08
oracle常见锁表处理方式
Monai version has been updated to 0.9. See what new functions it has
After the uniapp jumps to the page in onlaunch, click the event failure solution
Verilog 实现数码管显视驱动【附源码】
[untitled]
2021-05-21
Transaction rolled back because it has been marked as rollback only
Introduction to shell programming
China Southern Airlines pa3.1
Opencv installation and environment configuration - vs2017
Unity script visualization about layout code